Switching to ObjectDisposedException.ThrowIf

This commit is contained in:
Jeremy Sinclair 2023-08-16 13:19:51 -04:00
parent 575e49f70c
commit 27f4f56d2d
2 changed files with 2 additions and 8 deletions

View File

@ -220,9 +220,6 @@ public class WrappingStream : Stream
private void ThrowIfDisposed() private void ThrowIfDisposed()
{ {
// throws an ObjectDisposedException if this object has been disposed // throws an ObjectDisposedException if this object has been disposed
if (_streamBase == null) ObjectDisposedException.ThrowIf(_streamBase == null, this);
{
throw new ObjectDisposedException(GetType().Name);
}
} }
} }

View File

@ -240,10 +240,7 @@ namespace Common.Utilities
private void CheckDisposed() private void CheckDisposed()
{ {
if (_stream == null) ObjectDisposedException.ThrowIf(_stream == null, this);
{
throw new ObjectDisposedException(nameof(ReadonlyStream));
}
} }
} }
} }