Skip to content

Commit a5ac2bf

Browse files
Workaround for a bug where no tasks are returned for a project id it has an exception.
1 parent a1ecb1b commit a5ac2bf

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.vscode/launch.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"request": "launch",
1010
"name": "Launch",
1111
"program": "${workspaceFolder}\\index.js",
12-
"cwd": "${workspaceFolder}"
12+
"cwd": "${workspaceFolder}",
13+
"runtimeArgs": ["--tls-min-v1.0"]
1314
},
1415
{
1516
"type": "node",

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,11 @@ async function getActiveCollabProjectTasks (activeCollabProjectId) {
534534
if (projectTasks === undefined) {
535535
let activeCollabTasks = await activeCollab.tasks(activeCollabProjectId)
536536

537+
if (activeCollabTasks === null) {
538+
console.log(`No tasks found for Project ID: ${activeCollabProjectId}`);
539+
return [];
540+
}
541+
537542
// Reduce the array of objects down to key on task id.
538543
projectTasks = activeCollabTasks.reduce(function (obj, item) {
539544
obj[item.task_id] = item

0 commit comments

Comments
 (0)