Skip to content

Commit 5a64e49

Browse files
chore: custom label migration report fix
1 parent c30dba9 commit 5a64e49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/resultsbuilder/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ export class ResultsBuilder {
287287

288288
const pageSize = 1000; // Smaller page size for better performance
289289
const totalLabels = customLabelMigrationInfos.length;
290-
const totalPages = Math.ceil(totalLabels / pageSize);
290+
const totalPages = Math.max(1, Math.ceil(totalLabels / pageSize));
291291

292292
Logger.logVerbose(messages.getMessage('generatingCustomLabelsReport', [totalLabels, totalPages, pageSize]));
293293

@@ -827,7 +827,7 @@ export class ResultsBuilder {
827827
const totalLabels = result.totalCount || result.data?.length || 0;
828828
// Use actual processed records for file naming, not total count
829829
const processedRecords = result.data?.length || 0;
830-
const totalPages = Math.ceil(processedRecords / 1000);
830+
const totalPages = Math.max(1, Math.ceil(processedRecords / 1000));
831831
const fileName = totalPages > 1 ? `Custom_Labels_Page_1_of_${totalPages}.html` : 'Custom_Labels.html';
832832

833833
return {

0 commit comments

Comments
 (0)