From f9e7fb1f40a6162a6d19f3c838289676f6d08be8 Mon Sep 17 00:00:00 2001
From: JFronny <33260128+JFronny@users.noreply.github.com>
Date: Fri, 12 Jun 2020 14:48:28 +0200
Subject: [PATCH] Fix NullReferenceException in equality operations in Pixel.cs
---
Commandline/TUI/Pixel.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Commandline/TUI/Pixel.cs b/Commandline/TUI/Pixel.cs
index 71e0d15..3640bad 100644
--- a/Commandline/TUI/Pixel.cs
+++ b/Commandline/TUI/Pixel.cs
@@ -88,7 +88,7 @@ namespace CC_Functions.Commandline.TUI
/// First pixel to compare
/// Second pixel to compare
/// Whether they are equal
- public static bool operator ==(Pixel a, Pixel b) => a.Equals(b);
+ public static bool operator ==(Pixel a, Pixel b) => a != null && a.Equals(b);
///
/// Whether to pixels are not equal
@@ -96,7 +96,7 @@ namespace CC_Functions.Commandline.TUI
/// First pixel to compare
/// Second pixel to compare
/// Whether they are not equal
- public static bool operator !=(Pixel a, Pixel b) => !a.Equals(b);
+ public static bool operator !=(Pixel a, Pixel b) => a != null && !a.Equals(b);
///
/// Returns the content of this pixel