Skip to content

Commit d644f03

Browse files
Maydayofrose-a
andauthored
Update src/GraphQL.Client/GraphQLHttpClient.cs
Dispose if has value Co-authored-by: Alexander Rose <[email protected]>
1 parent 3106d0e commit d644f03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/GraphQL.Client/GraphQLHttpClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ protected virtual void Dispose(bool disposing)
188188
Debug.WriteLine($"Disposing GraphQLHttpClient on endpoint {Options.EndPoint}");
189189
_cancellationTokenSource.Cancel();
190190
HttpClient.Dispose();
191-
_lazyHttpWebSocket?.Value.Dispose();
191+
if(_lazyHttpWebSocket?.HasValue) _lazyHttpWebSocket?.Value.Dispose();
192192
_cancellationTokenSource.Dispose();
193193
}
194194
}

0 commit comments

Comments
 (0)