Skip to content

Commit 03b78f8

Browse files
fixed bug in identifier
1 parent 60fd4dc commit 03b78f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Protocol/Models/TextDocumentIdentifier.cs

Lines changed: 2 additions & 2 deletions
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?)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?)Uri)?.ToString() ?? string.Empty;
4646

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

0 commit comments

Comments
 (0)