diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs index 729b592a04..0064052c72 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs @@ -93,8 +93,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic directoryDropdown.ShowDropDown("LABEL_DROPDOWN_TEMPLATE", 210, mapDirectories.Keys, setupItem); } - var attr = File.GetAttributes(map.Path); - var mapIsUnpacked = attr.HasFlag(FileAttributes.Directory); + var mapIsUnpacked = false; + + if (map.Path != null) + { + var attr = File.GetAttributes(map.Path); + mapIsUnpacked = attr.HasFlag(FileAttributes.Directory); + } + var filename = widget.Get("FILENAME"); filename.Text = mapIsUnpacked ? Path.GetFileName(map.Path) : Path.GetFileNameWithoutExtension(map.Path); var fileType = mapIsUnpacked ? MapFileType.Unpacked : MapFileType.OraMap;