Skip to content

Commit d4a58a6

Browse files
committed
Consistently check for undefined rather than nullish
1 parent 65777b5 commit d4a58a6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

extensions/ql-vscode/src/view/results/alert-table.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -313,19 +313,19 @@ export class PathTable extends React.Component<PathTableProps, PathTableState> {
313313

314314
// Check if the selected node actually exists (bounds check) and get its location if relevant
315315
let jumpLocation: Sarif.Location | undefined;
316-
if (key.pathNodeIndex != null) {
316+
if (key.pathNodeIndex !== undefined) {
317317
jumpLocation = Keys.getPathNode(data, key);
318-
if (jumpLocation == null) {
318+
if (jumpLocation === undefined) {
319319
return prevState; // Result does not exist
320320
}
321-
} else if (key.pathIndex != null) {
322-
if (Keys.getPath(data, key) == null) {
321+
} else if (key.pathIndex !== undefined) {
322+
if (Keys.getPath(data, key) === undefined) {
323323
return prevState; // Path does not exist
324324
}
325325
jumpLocation = undefined; // When selecting a 'path', don't jump anywhere.
326326
} else {
327327
jumpLocation = Keys.getResult(data, key)?.locations?.[0];
328-
if (jumpLocation == null) {
328+
if (jumpLocation === undefined) {
329329
return prevState; // Path step does not exist.
330330
}
331331
}

0 commit comments

Comments
 (0)