Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Configurations/GrassCoverErosionInwardsCalculationConfigurationImporter.cs =================================================================== diff -u -rfcad48d7beb394e1ac15cfe4289a7381e05aa883 -rcd19eb98ca319a27489e518ce92f20e8ff633401 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Configurations/GrassCoverErosionInwardsCalculationConfigurationImporter.cs (.../GrassCoverErosionInwardsCalculationConfigurationImporter.cs) (revision fcad48d7beb394e1ac15cfe4289a7381e05aa883) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Configurations/GrassCoverErosionInwardsCalculationConfigurationImporter.cs (.../GrassCoverErosionInwardsCalculationConfigurationImporter.cs) (revision cd19eb98ca319a27489e518ce92f20e8ff633401) @@ -67,14 +67,17 @@ { throw new ArgumentNullException(nameof(hydraulicBoundaryLocations)); } + if (dikeProfiles == null) { throw new ArgumentNullException(nameof(dikeProfiles)); } + if (failureMechanism == null) { throw new ArgumentNullException(nameof(failureMechanism)); } + availableHydraulicBoundaryLocations = hydraulicBoundaryLocations; availableDikeProfiles = dikeProfiles; this.failureMechanism = failureMechanism; @@ -114,6 +117,7 @@ SetShouldIllustrationPointsBeCalculated(calculationConfiguration, calculation); return calculation; } + return null; } @@ -209,8 +213,10 @@ return false; } + calculation.InputParameters.DikeHeight = (RoundedDouble) calculationConfiguration.DikeHeight.Value; } + return true; } @@ -254,10 +260,12 @@ { calculation.InputParameters.ShouldOvertoppingOutputIllustrationPointsBeCalculated = calculationConfiguration.ShouldOvertoppingOutputIllustrationPointsBeCalculated.Value; } + if (calculationConfiguration.ShouldDikeHeightIllustrationPointsBeCalculated.HasValue) { calculation.InputParameters.ShouldDikeHeightIllustrationPointsBeCalculated = calculationConfiguration.ShouldDikeHeightIllustrationPointsBeCalculated.Value; } + if (calculationConfiguration.ShouldOvertoppingRateIllustrationPointsBeCalculated.HasValue) { calculation.InputParameters.ShouldOvertoppingRateIllustrationPointsBeCalculated = calculationConfiguration.ShouldOvertoppingRateIllustrationPointsBeCalculated.Value; @@ -309,17 +317,17 @@ return false; } } - else if (!calculation.InputParameters.ForeshoreGeometry.Any()) + else if (!calculation.InputParameters.ForeshoreGeometry.Any() + && waveReductionConfiguration?.UseForeshoreProfile != null + && waveReductionConfiguration.UseForeshoreProfile.Value) { - if (waveReductionConfiguration?.UseForeshoreProfile != null && waveReductionConfiguration.UseForeshoreProfile.Value) - { - Log.LogCalculationConversionError(string.Format( - Resources.GrassCoverErosionInwardsCalculationConfigurationImporter_ValidateWaveReduction_DikeProfile_0_has_no_geometry_and_cannot_be_used, - calculationConfiguration.DikeProfileId), - calculation.Name); - return false; - } + Log.LogCalculationConversionError(string.Format( + Resources.GrassCoverErosionInwardsCalculationConfigurationImporter_ValidateWaveReduction_DikeProfile_0_has_no_geometry_and_cannot_be_used, + calculationConfiguration.DikeProfileId), + calculation.Name); + return false; } + return true; } }