mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-19 22:37:58 +08:00
Switching to ObjectDisposedException.ThrowIf
This commit is contained in:
parent
575e49f70c
commit
27f4f56d2d
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -240,10 +240,7 @@ namespace Common.Utilities
|
||||
|
||||
private void CheckDisposed()
|
||||
{
|
||||
if (_stream == null)
|
||||
{
|
||||
throw new ObjectDisposedException(nameof(ReadonlyStream));
|
||||
}
|
||||
ObjectDisposedException.ThrowIf(_stream == null, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user