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()
{
// throws an ObjectDisposedException if this object has been disposed
if (_streamBase == null)
{
throw new ObjectDisposedException(GetType().Name);
}
ObjectDisposedException.ThrowIf(_streamBase == null, this);
}
}

View File

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