Index: Core/Components/src/Core.Components.DotSpatial/Converter/FeatureBasedMapDataConverter.cs =================================================================== diff -u -rf2367585bae1d0f3b4d999e905fa8ac742f244bf -re611a8f9a7735c41731487fa449a7e7a092db10b --- Core/Components/src/Core.Components.DotSpatial/Converter/FeatureBasedMapDataConverter.cs (.../FeatureBasedMapDataConverter.cs) (revision f2367585bae1d0f3b4d999e905fa8ac742f244bf) +++ Core/Components/src/Core.Components.DotSpatial/Converter/FeatureBasedMapDataConverter.cs (.../FeatureBasedMapDataConverter.cs) (revision e611a8f9a7735c41731487fa449a7e7a092db10b) @@ -62,14 +62,14 @@ public void ConvertLayerFeatures(FeatureBasedMapData data, IMapFeatureLayer layer) { - ValidateParameters(data); + ValidateParameters(data, layer); ConvertLayerFeaturesInternal(data, layer); } public void ConvertLayerProperties(FeatureBasedMapData data, IMapFeatureLayer layer) { - ValidateParameters(data); + ValidateParameters(data, layer); ConvertLayerPropertiesInternal(data, layer); } @@ -120,6 +120,16 @@ } } + private void ValidateParameters(FeatureBasedMapData data, IMapFeatureLayer layer) + { + ValidateParameters(data); + + if (layer == null) + { + throw new ArgumentNullException("layer", @"Null data cannot be used as conversion target."); + } + } + private void ConvertLayerFeaturesInternal(FeatureBasedMapData data, IFeatureLayer layer) { ClearLayerData(layer); Index: Core/Components/src/Core.Components.DotSpatial/Converter/IFeatureBasedMapDataConverter.cs =================================================================== diff -u -r36ad62b60021e13af670bac0b725c1e2e960efd0 -re611a8f9a7735c41731487fa449a7e7a092db10b --- Core/Components/src/Core.Components.DotSpatial/Converter/IFeatureBasedMapDataConverter.cs (.../IFeatureBasedMapDataConverter.cs) (revision 36ad62b60021e13af670bac0b725c1e2e960efd0) +++ Core/Components/src/Core.Components.DotSpatial/Converter/IFeatureBasedMapDataConverter.cs (.../IFeatureBasedMapDataConverter.cs) (revision e611a8f9a7735c41731487fa449a7e7a092db10b) @@ -53,7 +53,7 @@ /// The data to convert the feature related data from. /// The layer to convert the feature related data to. /// Thrown when returns false. - /// Thrown when is null. + /// Thrown when or is null. void ConvertLayerFeatures(FeatureBasedMapData data, IMapFeatureLayer layer); /// @@ -63,7 +63,7 @@ /// The data to convert the general properties from. /// The layer to convert the general properties to. /// Thrown when returns false. - /// Thrown when is null. + /// Thrown when or is null. void ConvertLayerProperties(FeatureBasedMapData data, IMapFeatureLayer layer); } } \ No newline at end of file