Skip to content

Commit 32a53f9

Browse files
authored
Merge pull request #13 from datatheorem/better-handling-of-missing-static-scan-status
Better handling of missing static_scan field
2 parents 644de40 + cbb0efd commit 32a53f9

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ function check_severity_findings(dt_results_api_key, mobile_app_id, results_sinc
8989
});
9090
}
9191
function run() {
92+
var _a;
9293
return __awaiter(this, void 0, void 0, function* () {
9394
// Get inputs
9495
// Mandatory
@@ -291,7 +292,7 @@ function run() {
291292
continue;
292293
}
293294
const status_data = yield status_response.json();
294-
const scan_status = status_data.static_scan.status || status_data.status;
295+
const scan_status = ((_a = status_data.static_scan) === null || _a === void 0 ? void 0 : _a.status) || status_data.status;
295296
if (scan_status &&
296297
["FAILED", "SCAN_ATTEMPT_ERROR", "CANCELLED"].includes(scan_status)) {
297298
console.log(`Scan ${scan_id} failed, skipping vulnerability check`);

main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ async function run() {
363363
}
364364

365365
const status_data = await status_response.json();
366-
const scan_status = status_data.static_scan.status || status_data.status;
366+
const scan_status = status_data.static_scan?.status || status_data.status;
367367
if (
368368
scan_status &&
369369
["FAILED", "SCAN_ATTEMPT_ERROR", "CANCELLED"].includes(scan_status)

0 commit comments

Comments
 (0)