Fix crash when saving a map without overriding an existing file
This commit is contained in:
parent
8edb1bb2b6
commit
d7ee3cee6d
@ -858,7 +858,8 @@ namespace MobiusEditor
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new FileInfo(saveFilename).Length > Globals.MaxMapSize)
|
var fileInfo = new FileInfo(saveFilename);
|
||||||
|
if (fileInfo.Exists && fileInfo.Length > Globals.MaxMapSize)
|
||||||
{
|
{
|
||||||
MessageBox.Show(string.Format("Map file exceeds the maximum size of {0} bytes.", Globals.MaxMapSize), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBox.Show(string.Format("Map file exceeds the maximum size of {0} bytes.", Globals.MaxMapSize), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user