Skip to content

Commit eec2f33

Browse files
Check for underfined before filtering
1 parent 78e794c commit eec2f33

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

extensions/ql-vscode/src/queries-panel/query-pack-discovery.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,13 @@ export class QueryPackDiscovery extends FilePathDiscovery<QueryPack> {
3636
* or the pack's language is unknown.
3737
*/
3838
public getLanguageForQueryFile(queryPath: string): QueryLanguage | undefined {
39+
const pathData = this.getPathData();
40+
if (pathData === undefined) {
41+
return undefined;
42+
}
43+
3944
// Find all packs in a higher directory than the query
40-
const packs = (this.getPathData() || []).filter((queryPack) =>
45+
const packs = pathData.filter((queryPack) =>
4146
containsPath(dirname(queryPack.path), queryPath),
4247
);
4348

0 commit comments

Comments
 (0)