From 44595496be5fe97d4b0edfb28ce673b2585e544b Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Sat, 22 Dec 2018 00:17:23 +0300 Subject: [PATCH] Fixed #37 --- OWTrack/MainForm.cs | 11 ++++++++++- OWTrack/saveManeger.cs | 5 +++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/OWTrack/MainForm.cs b/OWTrack/MainForm.cs index 28713ab..61466f3 100644 --- a/OWTrack/MainForm.cs +++ b/OWTrack/MainForm.cs @@ -86,7 +86,16 @@ namespace OWTrack { try { - tr = saveManeger.GetSavedTracker(); + try + { + tr = saveManeger.GetSavedTracker(); + } + catch (Exception) + { + MessageBox.Show("Could not load Save.\n" + + "Starting new save."); + tr = new Tracker(); + } if (tr.startSR > 0) SRonce = true; if (tr.settings.GamePath == "" || tr.settings.GamePath == null) { diff --git a/OWTrack/saveManeger.cs b/OWTrack/saveManeger.cs index ab9fe1d..8cb03e0 100644 --- a/OWTrack/saveManeger.cs +++ b/OWTrack/saveManeger.cs @@ -55,9 +55,10 @@ namespace OWTrack { return JsonConvert.DeserializeObject(File.ReadAllText(Paths.GetSaves())); } - catch (Exception e) + catch (Exception) { - throw e; + Exception ex = new Exception("json"); + throw ex; } }