Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Standard/ThrowHelper.cs =================================================================== diff -u -r3893 -r4000 --- DamEngine/trunk/src/Deltares.DamEngine.Data/Standard/ThrowHelper.cs (.../ThrowHelper.cs) (revision 3893) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/Standard/ThrowHelper.cs (.../ThrowHelper.cs) (revision 4000) @@ -37,10 +37,12 @@ public static void ThrowWhenConditionIsTrue(string message, Func condition) where TException : Exception { - var exception = (Exception)Activator.CreateInstance(typeof(TException), new object[] { message }); + var exception = (Exception) Activator.CreateInstance(typeof(TException), message); if (condition()) + { throw exception; + } } /// @@ -52,7 +54,9 @@ public static void ThrowIfArgumentNull(object value, string message) { if (value == null) + { throw new ArgumentNullException(message); + } } } -} +} \ No newline at end of file