Index: Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingCalculationService.cs
===================================================================
diff -u -r62cd6e02ab9b63a64de1cc9e3a51ab776c7aab67 -r573900f6a5c0131bac790e0a06d038bc2111cb6f
--- Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingCalculationService.cs (.../PipingCalculationService.cs) (revision 62cd6e02ab9b63a64de1cc9e3a51ab776c7aab67)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingCalculationService.cs (.../PipingCalculationService.cs) (revision 573900f6a5c0131bac790e0a06d038bc2111cb6f)
@@ -19,6 +19,7 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
+using System;
using System.Collections.Generic;
using System.Linq;
using Core.Common.Base.Data;
@@ -45,8 +46,14 @@
///
/// The for which to validate the values.
/// False if contains validation errors; True otherwise.
+ /// Thrown when is null.
public static bool Validate(PipingCalculation calculation)
{
+ if (calculation == null)
+ {
+ throw new ArgumentNullException(nameof(calculation));
+ }
+
CalculationServiceHelper.LogValidationBeginTime(calculation.Name);
CalculationServiceHelper.LogMessagesAsWarning(GetInputWarnings(calculation.InputParameters).ToArray());
@@ -73,9 +80,15 @@
/// the execution of the operation.
///
/// The to base the input for the calculation upon.
+ /// Thrown when is null.
/// Consider calling first to see if calculation is possible.
public static void Calculate(PipingCalculation calculation)
{
+ if (calculation == null)
+ {
+ throw new ArgumentNullException(nameof(calculation));
+ }
+
CalculationServiceHelper.LogCalculationBeginTime(calculation.Name);
try
@@ -367,7 +380,7 @@
BeddingAngle = inputParameters.BeddingAngle,
ExitPointXCoordinate = inputParameters.ExitPointL,
SurfaceLine = inputParameters.SurfaceLine,
- SoilProfile = inputParameters.StochasticSoilProfile == null ? null : inputParameters.StochasticSoilProfile.SoilProfile
+ SoilProfile = inputParameters.StochasticSoilProfile?.SoilProfile
});
}
}