We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 53bb9d7 commit 65777b5Copy full SHA for 65777b5
extensions/ql-vscode/src/pure/result-keys.ts
@@ -40,10 +40,7 @@ export type ResultKey = Result | Path | PathNode;
40
* Looks up a specific result in a result set.
41
*/
42
export function getResult(sarif: sarif.Log, key: Result | Path | PathNode): sarif.Result | undefined {
43
- if (sarif.runs.length === 0) return undefined;
44
- if (sarif.runs[0].results === undefined) return undefined;
45
- const results = sarif.runs[0].results;
46
- return results[key.resultIndex];
+ return sarif.runs[0]?.results?.[key.resultIndex];
47
}
48
49
/**
0 commit comments