diff --git a/src/ImageSharp/ImageFrameCollection.cs b/src/ImageSharp/ImageFrameCollection.cs index 0318a7068..cacad34a4 100644 --- a/src/ImageSharp/ImageFrameCollection.cs +++ b/src/ImageSharp/ImageFrameCollection.cs @@ -32,7 +32,7 @@ namespace SixLabors.ImageSharp internal ImageFrameCollection(Image parent, IEnumerable> frames) { Guard.NotNull(parent, nameof(parent)); - Guard.NotNullOrEmpty(frames, nameof(frames)); + Guard.NotNull(frames, nameof(frames)); this.parent = parent; @@ -42,6 +42,12 @@ namespace SixLabors.ImageSharp this.ValidateFrame(f); this.frames.Add(f); } + + // Ensure at least 1 frame was added to the frames collection + if (this.frames.Count == 0) + { + throw new ArgumentException("Must not be empty.", nameof(frames)); + } } ///