Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/Geometry2DImporter/SoilProfile2DImporter.cs =================================================================== diff -u -r4872 -r4878 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/Geometry2DImporter/SoilProfile2DImporter.cs (.../SoilProfile2DImporter.cs) (revision 4872) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/Geometry2DImporter/SoilProfile2DImporter.cs (.../SoilProfile2DImporter.cs) (revision 4878) @@ -72,12 +72,12 @@ { string profileName = profile.SoilGeometry2DName; SoilProfile2D readSoilProfile = ReadSoilProfile(soilProfileDirectory, profileName); - foreach (SoilLayer2D surface in readSoilProfile.Surfaces) + foreach (string soilName in readSoilProfile.Surfaces.Select(surface => surface.Soil.Name)) { - if (!IsSoilOfSurfacePresent(availableSoils.Soils, surface.Soil.Name)) + if (!IsSoilOfSurfacePresent(availableSoils.Soils, soilName)) { string messageFormat = LocalizationManager.GetTranslatedText(typeof(SoilProfile2DImporter), "ImportSoilProfileErrorUndefinedMaterials"); - throw new SoilProfileImporterException(string.Format(messageFormat, profileName, surface.Soil.Name)); + throw new SoilProfileImporterException(string.Format(messageFormat, profileName, soilName)); } } TransferSoilLayerProperties(readSoilProfile.Surfaces);