From 9fd97ee467f667e54e4f18058154f2bf518eccf6 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Mon, 12 Jun 2017 06:14:22 -0700 Subject: [PATCH] Make sure to perform null check before invoking event handler --- DS4Windows/DS4Forms/AdvancedColorDialog.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DS4Windows/DS4Forms/AdvancedColorDialog.cs b/DS4Windows/DS4Forms/AdvancedColorDialog.cs index 0e47bd1..dc4ce78 100644 --- a/DS4Windows/DS4Forms/AdvancedColorDialog.cs +++ b/DS4Windows/DS4Forms/AdvancedColorDialog.cs @@ -160,7 +160,7 @@ namespace DS4Windows if (Byte.TryParse(WindowsEnumerator.WindowText(EditWindows[3].hWnd), out red)) if (Byte.TryParse(WindowsEnumerator.WindowText(EditWindows[4].hWnd), out green)) if (Byte.TryParse(WindowsEnumerator.WindowText(EditWindows[5].hWnd), out blue)) - OnUpdateColor(Color.FromArgb(red, green, blue), EventArgs.Empty); + OnUpdateColor?.Invoke(Color.FromArgb(red, green, blue), EventArgs.Empty); } } // Always call the base class hook procedure.