fix a crash on new map creation
This commit is contained in:
@@ -93,8 +93,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
directoryDropdown.ShowDropDown("LABEL_DROPDOWN_TEMPLATE", 210, mapDirectories.Keys, setupItem);
|
directoryDropdown.ShowDropDown("LABEL_DROPDOWN_TEMPLATE", 210, mapDirectories.Keys, setupItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
var attr = File.GetAttributes(map.Path);
|
var mapIsUnpacked = false;
|
||||||
var mapIsUnpacked = attr.HasFlag(FileAttributes.Directory);
|
|
||||||
|
if (map.Path != null)
|
||||||
|
{
|
||||||
|
var attr = File.GetAttributes(map.Path);
|
||||||
|
mapIsUnpacked = attr.HasFlag(FileAttributes.Directory);
|
||||||
|
}
|
||||||
|
|
||||||
var filename = widget.Get<TextFieldWidget>("FILENAME");
|
var filename = widget.Get<TextFieldWidget>("FILENAME");
|
||||||
filename.Text = mapIsUnpacked ? Path.GetFileName(map.Path) : Path.GetFileNameWithoutExtension(map.Path);
|
filename.Text = mapIsUnpacked ? Path.GetFileName(map.Path) : Path.GetFileNameWithoutExtension(map.Path);
|
||||||
var fileType = mapIsUnpacked ? MapFileType.Unpacked : MapFileType.OraMap;
|
var fileType = mapIsUnpacked ? MapFileType.Unpacked : MapFileType.OraMap;
|
||||||
|
|||||||
Reference in New Issue
Block a user