mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-08 23:32:36 -05:00
fix some npes
This commit is contained in:
@@ -622,6 +622,10 @@ export function startsWithUTF8BOM(str: string): boolean {
|
||||
export function score(target: string, query: string): number {
|
||||
let score = 0;
|
||||
|
||||
if (!target || !query) {
|
||||
return score; // return early if target or query are undefined
|
||||
}
|
||||
|
||||
const queryLen = query.length;
|
||||
const targetLower = target.toLowerCase();
|
||||
const queryLower = query.toLowerCase();
|
||||
|
||||
@@ -186,7 +186,7 @@ export class QuickOpenEntry {
|
||||
}
|
||||
}
|
||||
|
||||
return compareAnything(nameA, nameB, lookFor.toLowerCase());
|
||||
return compareAnything(nameA, nameB, lookFor ? lookFor.toLowerCase() : lookFor);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user