Skip to content

Commit 568f082

Browse files
committed
Fix some crashes when pretty-printing an empty name
Predicate names can't be empty, but it can happen with the renaming feature added in the next commit.
1 parent 4a835b8 commit 568f082

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

extensions/ql-vscode/src/view/compare-performance/RAPrettyPrinter.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ function parseName(text: string): QualifiedName {
7070
let args: QualifiedName[] | undefined;
7171
if (skipToken(">")) {
7272
args = [];
73-
while (peek() !== "<") {
73+
while (tokens.length > 0 && peek() !== "<") {
7474
args.push(parseQName());
7575
skipToken(",");
7676
}
7777
args.reverse();
7878
skipToken("<");
7979
}
80-
const name = next();
80+
const name = tokens.length === 0 ? "" : next();
8181
const prefix = skipToken("::") ? parseQName() : undefined;
8282
return {
8383
prefix,

0 commit comments

Comments
 (0)