From f56105393b2e9300dfba5cf4979578f7a99c176b Mon Sep 17 00:00:00 2001 From: Dmitry Pentin Date: Fri, 14 May 2021 19:14:53 +0300 Subject: [PATCH] Fixed a couple of failing tests --- src/ImageSharp/ImageFrameCollection.cs | 7 ++++++- src/ImageSharp/ImageFrameCollection{TPixel}.cs | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/ImageSharp/ImageFrameCollection.cs b/src/ImageSharp/ImageFrameCollection.cs index 53ab2bf7c1..ed36c16539 100644 --- a/src/ImageSharp/ImageFrameCollection.cs +++ b/src/ImageSharp/ImageFrameCollection.cs @@ -70,7 +70,12 @@ namespace SixLabors.ImageSharp /// The to clone and insert into the . /// Frame must have the same dimensions as the image. /// The cloned . - public ImageFrame InsertFrame(int index, ImageFrame source) => this.NonGenericInsertFrame(index, source); + public ImageFrame InsertFrame(int index, ImageFrame source) + { + this.EnsureNotDisposed(); + + return this.NonGenericInsertFrame(index, source); + } /// /// Clones the frame and appends the clone to the end of the collection. diff --git a/src/ImageSharp/ImageFrameCollection{TPixel}.cs b/src/ImageSharp/ImageFrameCollection{TPixel}.cs index 92722494b1..13ae092c42 100644 --- a/src/ImageSharp/ImageFrameCollection{TPixel}.cs +++ b/src/ImageSharp/ImageFrameCollection{TPixel}.cs @@ -110,7 +110,12 @@ namespace SixLabors.ImageSharp } /// - public override int IndexOf(ImageFrame frame) => frame is ImageFrame specific ? this.IndexOf(specific) : -1; + public override int IndexOf(ImageFrame frame) + { + this.EnsureNotDisposed(); + + return frame is ImageFrame specific ? this.frames.IndexOf(specific) : -1; + } /// /// Determines the index of a specific in the .