From a71ce1913f6066b3cf9769f37cbea063c57c3e23 Mon Sep 17 00:00:00 2001 From: Dmitry Pentin Date: Fri, 14 May 2021 05:28:28 +0300 Subject: [PATCH] ImageFrameCollection.Contains first checks if it was disposed first --- src/ImageSharp/ImageFrameCollection{TPixel}.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ImageSharp/ImageFrameCollection{TPixel}.cs b/src/ImageSharp/ImageFrameCollection{TPixel}.cs index 023da0d347..92722494b1 100644 --- a/src/ImageSharp/ImageFrameCollection{TPixel}.cs +++ b/src/ImageSharp/ImageFrameCollection{TPixel}.cs @@ -208,8 +208,12 @@ namespace SixLabors.ImageSharp } /// - public override bool Contains(ImageFrame frame) => - frame is ImageFrame specific && this.Contains(specific); + public override bool Contains(ImageFrame frame) + { + this.EnsureNotDisposed(); + + return frame is ImageFrame specific && this.frames.Contains(specific); + } /// /// Determines whether the contains the .