Skip to content

Commit cea99e7

Browse files
committed
Fix ObjectDisposedException message
The call to ObjectDisposedThrowHelper.ThrowIf expects an instance or a type. This code was passing a name, which resulted in an error message resembling: System.ObjectDisposedException : Cannot access a disposed object. Object name: 'System.String'.
1 parent f2709f1 commit cea99e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Grpc.Net.Client/GrpcChannel.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ internal void RegisterActiveCall(IDisposable grpcCall)
545545
{
546546
// Test the disposed flag inside the lock to ensure there is no chance of a race and adding a call after dispose.
547547
// Note that a GrpcCall has been created but hasn't been started. The error will prevent it from starting.
548-
ObjectDisposedThrowHelper.ThrowIf(Disposed, nameof(GrpcChannel));
548+
ObjectDisposedThrowHelper.ThrowIf(Disposed, typeof(GrpcChannel));
549549

550550
_activeCalls.Add(grpcCall);
551551
}

0 commit comments

Comments
 (0)