Skip to content

Commit 7ca456d

Browse files
committed
Ensure all fields have labels
Never show an empty string in the results view. This fixes #535 (again).
1 parent 5244a1c commit 7ca456d

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

extensions/ql-vscode/src/view/result-table-utils.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,6 @@ export function renderLocation(
6868
callback?: () => void
6969
): JSX.Element {
7070

71-
if (loc === undefined) {
72-
return <span />;
73-
} else if (isStringLoc(loc)) {
74-
return <a href={loc}>{loc}</a>;
75-
}
76-
7771
// If the label was empty, use a placeholder instead, so the link is still clickable.
7872
let displayLabel = label;
7973
if (!label) {
@@ -82,6 +76,12 @@ export function renderLocation(
8276
displayLabel = `[whitespace: "${label}"]`;
8377
}
8478

79+
if (loc === undefined) {
80+
return <span>{displayLabel}</span>;
81+
} else if (isStringLoc(loc)) {
82+
return <a href={loc}>{loc}</a>;
83+
}
84+
8585
const resolvableLoc = tryGetResolvableLocation(loc);
8686
if (resolvableLoc !== undefined) {
8787
return (

0 commit comments

Comments
 (0)