diff --git a/src/ImageSharp/Common/Helpers/Guard.cs b/src/ImageSharp/Common/Helpers/Guard.cs index 751920683e..8ce6c4b4d6 100644 --- a/src/ImageSharp/Common/Helpers/Guard.cs +++ b/src/ImageSharp/Common/Helpers/Guard.cs @@ -20,10 +20,12 @@ namespace SixLabors [MethodImpl(InliningOptions.ShortMethod)] public static void MustBeValueType(TValue value, string parameterName) { - if (!value.GetType().GetTypeInfo().IsValueType) + if (value.GetType().GetTypeInfo().IsValueType) { - ThrowHelper.ThrowArgumentException("Type must be a struct.", parameterName); + return; } + + ThrowHelper.ThrowArgumentException("Type must be a struct.", parameterName); } } }