🐛Fix when stats settings is null, fixes #166.

This commit is contained in:
2018-02-23 09:47:41 +00:00
parent af80ebafed
commit 7cba023f84
2 changed files with 5 additions and 4 deletions

View File

@@ -186,7 +186,7 @@ namespace DiscImageChef.Core
fs.Close();
}
if(Settings.Settings.Current.Stats.ShareStats) SubmitStats();
if(Settings.Settings.Current.Stats != null && Settings.Settings.Current.Stats.ShareStats) SubmitStats();
}
/// <summary>
@@ -216,7 +216,7 @@ namespace DiscImageChef.Core
System.Console.WriteLine("Uploading partial statistics file {0}", statsFile);
#else
DiscImageChef.Console.DicConsole.DebugWriteLine("Submit stats", "Uploading partial statistics file {0}", statsFile);
#endif
#endif
FileStream fs = new FileStream(statsFile, FileMode.Open, FileAccess.Read);
XmlSerializer xs = new XmlSerializer(stats.GetType());
@@ -258,7 +258,7 @@ namespace DiscImageChef.Core
throw;
#else
continue;
#endif
#endif
}
submitStatsLock = false;