mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-01-23 02:12:14 +00:00
Catch invalid skin file
I accidentally tried to load 0.0.x skin file, and it crashed. Added a try/catch around it and if caught, give an infobox saying "This skin is not compatible with this version of ShiftOS.".
This commit is contained in:
parent
5b8d350af0
commit
2fede89938
1 changed files with 9 additions and 1 deletions
|
@ -313,7 +313,15 @@ namespace ShiftOS.WinForms.Applications
|
|||
{
|
||||
AppearanceManager.SetupDialog(new FileDialog(new[] { ".skn" }, FileOpenerStyle.Open, new Action<string>((filename) =>
|
||||
{
|
||||
LoadedSkin = JsonConvert.DeserializeObject<Skin>(ShiftOS.Objects.ShiftFS.Utils.ReadAllText(filename));
|
||||
try
|
||||
{
|
||||
LoadedSkin = JsonConvert.DeserializeObject<Skin>(ShiftOS.Objects.ShiftFS.Utils.ReadAllText(filename));
|
||||
}
|
||||
catch
|
||||
{
|
||||
Infobox.Show("Invalid Skin", "This skin is not compatible with this version of ShiftOS.");
|
||||
}
|
||||
|
||||
SetupUI();
|
||||
})));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue