Skip to content

Commit 6f46bcc

Browse files
committed
Add better error message when comparing queries
Also, fix type error.
1 parent 6ae6e91 commit 6f46bcc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

extensions/ql-vscode/src/query-history.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ the file in the file explorer and dragging it into the workspace.`
554554
return otherQuery;
555555
}
556556

557-
if (multiSelect.length > 1) {
557+
if (multiSelect?.length > 1) {
558558
throw new Error('Please select no more than 2 queries.');
559559
}
560560

@@ -572,6 +572,9 @@ the file in the file explorer and dragging it into the workspace.`
572572
detail: otherQuery.statusString,
573573
query: otherQuery,
574574
}));
575+
if (comparableQueryLabels.length < 1) {
576+
throw new Error('No other queries available to compare with.');
577+
}
575578
const choice = await vscode.window.showQuickPick(comparableQueryLabels);
576579
return choice?.query;
577580
}

0 commit comments

Comments
 (0)