Skip to content

Commit 293a3f5

Browse files
committed
Support having no starting lists
1 parent d6a7215 commit 293a3f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export const synchronizeZeroTrustLists = async (items) => {
165165
// Are there any more appends remaining?
166166
if (toAdd.length) {
167167
// We'll need to create new list(s)
168-
const nextListNumber = Math.max(...cgpsLists.map(list => parseInt(list.name.replace('CGPS List - Chunk ', ''))).filter(x => Number.isInteger(x))) + 1;
168+
const nextListNumber = Math.max(0, ...cgpsLists.map(list => parseInt(list.name.replace('CGPS List - Chunk ', ''))).filter(x => Number.isInteger(x))) + 1;
169169
await createZeroTrustListsOneByOne(toAdd, nextListNumber);
170170
}
171171
};

0 commit comments

Comments
 (0)