Skip to content

Commit c311057

Browse files
committed
Adding optional chaining to avoid exceptions on empty lists
1 parent 06f6140 commit c311057

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

components/monday/monday.app.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@ export default {
132132
boardId: +boardId,
133133
});
134134
return columns
135-
.filter((column) => column.id !== "name")
135+
?.filter((column) => column.id !== "name")
136136
.map((column) => ({
137137
label: column.title,
138138
value: column.id,
139-
}));
139+
})) ?? [];
140140
},
141141
},
142142
},
@@ -385,13 +385,13 @@ export default {
385385

386386
const { boards } = data;
387387
return boards
388-
.filter(({ type }) => type !== constants.BOARD_TYPE.SUB_ITEMS_BOARD)
388+
?.filter(({ type }) => type !== constants.BOARD_TYPE.SUB_ITEMS_BOARD)
389389
.map(({
390390
id, name,
391391
}) => ({
392392
label: name,
393393
value: id,
394-
}));
394+
})) ?? [];
395395
},
396396
async listFolderOptions(variables) {
397397
const {

0 commit comments

Comments
 (0)