From fed57b541824b922312222451a8a2dbeb14055f3 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Fri, 10 Jul 2020 17:00:46 +0100 Subject: [PATCH] Restore missing Guard --- src/ImageSharp/Image.FromStream.cs | 7 +++++-- .../General/IO/BufferedReadStreamWrapper.cs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ImageSharp/Image.FromStream.cs b/src/ImageSharp/Image.FromStream.cs index 1621724b0d..e882bf2f8d 100644 --- a/src/ImageSharp/Image.FromStream.cs +++ b/src/ImageSharp/Image.FromStream.cs @@ -292,7 +292,10 @@ namespace SixLabors.ImageSharp /// Image contains invalid content. /// A new . public static Image Load(Configuration configuration, Stream stream, IImageDecoder decoder) - => WithSeekableStream(configuration, stream, s => decoder.Decode(configuration, s)); + { + Guard.NotNull(decoder, nameof(decoder)); + return WithSeekableStream(configuration, stream, s => decoder.Decode(configuration, s)); + } /// /// Decode a new instance of the class from the given stream. @@ -327,7 +330,7 @@ namespace SixLabors.ImageSharp /// The stream is not readable. /// Image format not recognised. /// Image contains invalid content. - /// A new .> + /// A new . public static Image Load(Configuration configuration, Stream stream) => Load(configuration, stream, out _); /// diff --git a/tests/ImageSharp.Benchmarks/General/IO/BufferedReadStreamWrapper.cs b/tests/ImageSharp.Benchmarks/General/IO/BufferedReadStreamWrapper.cs index 76a48af211..baabb4784b 100644 --- a/tests/ImageSharp.Benchmarks/General/IO/BufferedReadStreamWrapper.cs +++ b/tests/ImageSharp.Benchmarks/General/IO/BufferedReadStreamWrapper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors. // Licensed under the Apache License, Version 2.0. using System;