diff --git a/ICD.Common.Utils/Extensions/EventHandlerExtensions.cs b/ICD.Common.Utils/Extensions/EventHandlerExtensions.cs index 958cf38..cb812b7 100644 --- a/ICD.Common.Utils/Extensions/EventHandlerExtensions.cs +++ b/ICD.Common.Utils/Extensions/EventHandlerExtensions.cs @@ -14,6 +14,9 @@ namespace ICD.Common.Utils.Extensions /// public static void Raise(this EventHandler extends, object sender) { + if (sender == null) + throw new ArgumentNullException("sender"); + if (extends != null) extends(sender, EventArgs.Empty); } @@ -28,6 +31,12 @@ namespace ICD.Common.Utils.Extensions public static void Raise(this EventHandler extends, object sender, T args) where T : EventArgs { + if (sender == null) + throw new ArgumentNullException("sender"); + + if (args == null) + throw new ArgumentNullException("args"); + if (extends != null) extends(sender, args); }