Make sure to perform null check before invoking event handler

This commit is contained in:
Travis Nickles 2017-06-12 06:14:22 -07:00
parent 2cf33e1bba
commit 9fd97ee467

View File

@ -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.