Skip to content

Commit 5521c00

Browse files
committed
Add check for id property when running variant analysis
1 parent eb71df8 commit 5521c00

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

extensions/ql-vscode/src/variant-analysis/variant-analysis-manager.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,17 @@ export class VariantAnalysisManager
327327
);
328328
}
329329

330+
// It's not possible to interpret a BQRS file to SARIF without an id property.
331+
if (
332+
queryMetadata?.kind &&
333+
["problem", "path-problem"].includes(queryMetadata.kind) &&
334+
!queryMetadata.id
335+
) {
336+
throw new UserCancellationException(
337+
`${firstQueryFile} does not have the required @id property for a ${queryMetadata.kind} query.`,
338+
);
339+
}
340+
330341
const {
331342
actionBranch,
332343
base64Pack,

0 commit comments

Comments
 (0)