Skip to content

Commit 4bb2ad6

Browse files
fixed bug in identifier
1 parent 60fd4dc commit 4bb2ad6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Protocol/Models/TextDocumentIdentifier.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public override bool Equals(object? obj)
3232
return Equals((TextDocumentIdentifier) obj);
3333
}
3434

35-
public override int GetHashCode() => Uri.GetHashCode();
35+
public override int GetHashCode() => Uri?.GetHashCode() ?? 0;
3636

3737
public static bool operator ==(TextDocumentIdentifier left, TextDocumentIdentifier right) => Equals(left, right);
3838

@@ -42,7 +42,7 @@ public override bool Equals(object? obj)
4242

4343
public static implicit operator TextDocumentIdentifier(string uri) => new TextDocumentIdentifier { Uri = uri };
4444

45-
private string DebuggerDisplay => Uri.ToString()!;
45+
private string DebuggerDisplay => Uri?.ToString() ?? string.Empty;
4646

4747
/// <inheritdoc />
4848
public override string ToString() => DebuggerDisplay;

0 commit comments

Comments
 (0)