From b646cb140226d834e74e3657f017bd36f44f23bb Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Tue, 4 Feb 2020 21:32:55 +1100 Subject: [PATCH] Fix tests --- src/ImageSharp/Color/Color.cs | 2 ++ src/ImageSharp/PixelFormats/PixelImplementations/Rgba32.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/ImageSharp/Color/Color.cs b/src/ImageSharp/Color/Color.cs index ad271dbf9b..fcf091638e 100644 --- a/src/ImageSharp/Color/Color.cs +++ b/src/ImageSharp/Color/Color.cs @@ -152,6 +152,8 @@ namespace SixLabors.ImageSharp /// public static Color Parse(string input) { + Guard.NotNull(input, nameof(input)); + if (!TryParse(input, out Color color)) { throw new ArgumentException("Input string is not in the correct format.", nameof(input)); diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Rgba32.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Rgba32.cs index 1449cb0301..62f8d97e8f 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/Rgba32.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/Rgba32.cs @@ -243,6 +243,8 @@ namespace SixLabors.ImageSharp.PixelFormats [MethodImpl(InliningOptions.ShortMethod)] public static Rgba32 ParseHex(string hex) { + Guard.NotNull(hex, nameof(hex)); + if (!TryParseHex(hex, out Rgba32 rgba)) { throw new ArgumentException("Hexadecimal string is not in the correct format.", nameof(hex));