diff --git a/CutList/Forms/Toolbox.cs b/CutList/Forms/Toolbox.cs index 99d896f..ea65c68 100644 --- a/CutList/Forms/Toolbox.cs +++ b/CutList/Forms/Toolbox.cs @@ -32,40 +32,26 @@ namespace CutList.Forms /// public void Load() { - try + if (!File.Exists(ToolsFilePath)) { - if (!File.Exists(ToolsFilePath)) - { - LoadDefaultTools(); - Save(); - } - else - { - var json = File.ReadAllText(ToolsFilePath); - var list = JsonConvert.DeserializeObject>(json); - Tools = list; - } + LoadDefaultTools(); + Save(); } - catch (Exception ex) + else { - throw; + var json = File.ReadAllText(ToolsFilePath); + var list = JsonConvert.DeserializeObject>(json); + Tools = list; } } public void Save() { - try - { - if (Tools == null) - return; + if (Tools == null) + return; - var json = JsonConvert.SerializeObject(Tools, Formatting.Indented); - File.WriteAllText(ToolsFilePath, json); - } - catch (Exception ex) - { - throw; - } + var json = JsonConvert.SerializeObject(Tools, Formatting.Indented); + File.WriteAllText(ToolsFilePath, json); } } } \ No newline at end of file