Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSoilProfilesImporter.cs =================================================================== diff -u -rbf334f50530164badedba45a78f3aab857ae1bf6 -r3f6060a9d5e2b63619d407706139325e8efb05df --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSoilProfilesImporter.cs (.../PipingSoilProfilesImporter.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSoilProfilesImporter.cs (.../PipingSoilProfilesImporter.cs) (revision 3f6060a9d5e2b63619d407706139325e8efb05df) @@ -185,12 +185,18 @@ private bool ValidateStochasticSoilModel(StochasticSoilModel stochasticSoilModel) { - if (stochasticSoilModel.StochasticSoilProfiles.Any(s => s.SoilProfile == null)) + if (!stochasticSoilModel.StochasticSoilProfiles.Any()) { log.WarnFormat(RingtoetsPluginResources.PipingSoilProfilesImporter_ValidateStochasticSoilModel_No_profiles_found_in_stochastic_soil_model_0, stochasticSoilModel.Name); return false; } + if (stochasticSoilModel.StochasticSoilProfiles.Any(ssp => ssp.SoilProfile == null)) + { + log.WarnFormat(RingtoetsPluginResources.PipingSoilProfilesImporter_ValidateStochasticSoilModel_SoilModel_0_with_stochastic_soil_profile_without_profile, + stochasticSoilModel.Name); + return false; + } if (!IsSumOfAllProbabilitiesEqualToOne(stochasticSoilModel)) { log.WarnFormat(RingtoetsPluginResources.PipingSoilProfilesImporter_ValidateStochasticSoilModel_Sum_of_probabilities_of_stochastic_soil_model_0_is_not_correct, @@ -212,7 +218,7 @@ return ((StochasticSoilModelContext) targetItem).AssessmentSection.ReferenceLine != null; } - private void HandleException(string path, Exception e) + private void HandleException(Exception e) { var message = string.Format(RingtoetsPluginResources.PipingSoilProfilesImporter_CriticalErrorMessage_0_File_Skipped, e.Message); @@ -235,17 +241,17 @@ { using (var stochasticSoilModelReader = new StochasticSoilModelReader(path)) { - return GetStochasticSoilModelReadResult(path, stochasticSoilModelReader); + return GetStochasticSoilModelReadResult(stochasticSoilModelReader); } } catch (CriticalFileReadException e) { - HandleException(path, e); + HandleException(e); } return new ReadResult(true); } - private ReadResult GetStochasticSoilModelReadResult(string path, StochasticSoilModelReader stochasticSoilModelReader) + private ReadResult GetStochasticSoilModelReadResult(StochasticSoilModelReader stochasticSoilModelReader) { var totalNumberOfSteps = stochasticSoilModelReader.PipingStochasticSoilModelCount; var currentStep = 1; @@ -290,7 +296,7 @@ } catch (CriticalFileReadException e) { - HandleException(path, e); + HandleException(e); } return new ReadResult(true); }