mirror of
https://github.com/jie65535/GrasscutterCommandGenerator.git
synced 2025-10-20 19:39:47 +08:00
Add empty file handling
This commit is contained in:
@@ -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)
|
||||||
|
Reference in New Issue
Block a user