Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilLayerHelper.cs =================================================================== diff -u -rc80d8d183c67dc32134ed57e051e87a2b2f657bf -r738617f07027419f558043bd50caf8e53663dd0d --- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilLayerHelper.cs (.../SoilLayerHelper.cs) (revision c80d8d183c67dc32134ed57e051e87a2b2f657bf) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilLayerHelper.cs (.../SoilLayerHelper.cs) (revision 738617f07027419f558043bd50caf8e53663dd0d) @@ -19,6 +19,8 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; + namespace Ringtoets.Common.IO.SoilProfile { /// @@ -35,9 +37,23 @@ /// on. /// The containing /// the values that needs to be set on the . + /// Thrown when any of the input parameter + /// is null. public static void SetSoilLayerBaseProperties(SoilLayerBase soilLayer, LayerProperties properties) { - soilLayer.MaterialName = properties.MaterialName ?? string.Empty; + if (soilLayer == null) + { + throw new ArgumentNullException(nameof(soilLayer)); + } + if (properties == null) + { + throw new ArgumentNullException(nameof(properties)); + } + + if (properties.MaterialName != null) + { + soilLayer.MaterialName = properties.MaterialName; + } if (properties.IsAquifer.HasValue) { soilLayer.IsAquifer = properties.IsAquifer.Value.Equals(1.0);