Skip to content

Commit 5013ef0

Browse files
authored
fix: Location & LocationLink#is npe. (#1003)
1 parent 536cc15 commit 5013ef0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

types/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ export namespace Location {
254254
*/
255255
export function is(value: any): value is Location {
256256
let candidate = value as Location;
257-
return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
257+
return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
258258
}
259259
}
260260

@@ -312,7 +312,7 @@ export namespace LocationLink {
312312
*/
313313
export function is(value: any): value is LocationLink {
314314
let candidate = value as LocationLink;
315-
return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)
315+
return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)
316316
&& Range.is(candidate.targetSelectionRange)
317317
&& (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
318318
}

0 commit comments

Comments
 (0)