Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismContext.cs
===================================================================
diff -u -r69bae9f753011e0f962a3ffa9b3c696efe5852dd -rc9ef60f6ee1db12e78cd9471f754c345e8b8d07d
--- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismContext.cs (.../FailureMechanismContext.cs) (revision 69bae9f753011e0f962a3ffa9b3c696efe5852dd)
+++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismContext.cs (.../FailureMechanismContext.cs) (revision c9ef60f6ee1db12e78cd9471f754c345e8b8d07d)
@@ -19,6 +19,7 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
+using System;
using Ringtoets.Common.Data;
namespace Ringtoets.Common.Forms.PresentationObjects
@@ -33,12 +34,28 @@
///
/// The failure mechanism.
/// The parent of .
+ /// Thrown when or are null.
protected FailureMechanismContext(T wrappedFailureMechanism, AssessmentSectionBase parent)
{
+ AssertInputsAreNotNull(wrappedFailureMechanism, parent);
+
WrappedData = wrappedFailureMechanism;
Parent = parent;
}
+ private void AssertInputsAreNotNull(T wrappedFailureMechanism, AssessmentSectionBase parent)
+ {
+ if (wrappedFailureMechanism == null)
+ {
+ throw new ArgumentNullException("wrappedFailureMechanism", "Failure mechanism cannot be null.");
+ }
+
+ if (parent == null)
+ {
+ throw new ArgumentNullException("parent", "The assessment section cannot be null.");
+ }
+ }
+
///
/// Gets the parent of .
///