mirror of
https://github.com/jie65535/GrasscutterCommandGenerator.git
synced 2025-06-08 23:19:14 +08:00
Add empty file handling
This commit is contained in:
parent
b05269712a
commit
a2494b59f7
@ -81,6 +81,7 @@ namespace GrasscutterTools.Forms
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
LoadBanners(Encoding.UTF8.GetString(Resources.Banners));
|
||||||
MessageBox.Show(ex.ToString(), Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBox.Show(ex.ToString(), Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -129,7 +130,10 @@ namespace GrasscutterTools.Forms
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadBanners(File.ReadAllText(path));
|
var content = File.ReadAllText(path);
|
||||||
|
if (string.IsNullOrEmpty(content))
|
||||||
|
content = Encoding.UTF8.GetString(Resources.Banners);
|
||||||
|
LoadBanners(content);
|
||||||
MessageBox.Show("OK", Resources.Tips, MessageBoxButtons.OK);
|
MessageBox.Show("OK", Resources.Tips, MessageBoxButtons.OK);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
Loading…
Reference in New Issue
Block a user