diff --git a/src/ImageSharp/Image{TPixel}.cs b/src/ImageSharp/Image{TPixel}.cs
index 4db3badb0..9c32a2c31 100644
--- a/src/ImageSharp/Image{TPixel}.cs
+++ b/src/ImageSharp/Image{TPixel}.cs
@@ -160,7 +160,7 @@ namespace SixLabors.ImageSharp
///
/// Gets the root frame.
///
- private IPixelSource PixelSource => this.Frames?.RootFrame ?? throw new ObjectDisposedException(nameof(Image));
+ private IPixelSource PixelSource => this.frames.RootFrame;
///
/// Gets or sets the pixel at the specified position.
@@ -174,6 +174,8 @@ namespace SixLabors.ImageSharp
[MethodImpl(InliningOptions.ShortMethod)]
get
{
+ this.EnsureNotDisposed();
+
this.VerifyCoords(x, y);
return this.PixelSource.PixelBuffer.GetElementUnsafe(x, y);
}
@@ -181,6 +183,8 @@ namespace SixLabors.ImageSharp
[MethodImpl(InliningOptions.ShortMethod)]
set
{
+ this.EnsureNotDisposed();
+
this.VerifyCoords(x, y);
this.PixelSource.PixelBuffer.GetElementUnsafe(x, y) = value;
}
@@ -198,6 +202,8 @@ namespace SixLabors.ImageSharp
Guard.MustBeGreaterThanOrEqualTo(rowIndex, 0, nameof(rowIndex));
Guard.MustBeLessThan(rowIndex, this.Height, nameof(rowIndex));
+ this.EnsureNotDisposed();
+
return this.PixelSource.PixelBuffer.GetRowSpan(rowIndex);
}