Improve protections around lastReadWhatsNew
This commit is contained in:
parent
19fb79769a
commit
64fbf007b7
1 changed files with 7 additions and 2 deletions
|
|
@ -119,9 +119,14 @@ namespace MatterHackers.MatterControl
|
|||
DateTime installTime = new FileInfo(filePath).LastWriteTime;
|
||||
var lastReadWhatsNew = UserSettings.Instance.get(UserSettingsKey.LastReadWhatsNew);
|
||||
DateTime whatsNewReadTime = installTime;
|
||||
if (lastReadWhatsNew != null)
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(lastReadWhatsNew))
|
||||
{
|
||||
whatsNewReadTime = JsonConvert.DeserializeObject<DateTime>(lastReadWhatsNew);
|
||||
try
|
||||
{
|
||||
whatsNewReadTime = JsonConvert.DeserializeObject<DateTime>(lastReadWhatsNew);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
return whatsNewReadTime > installTime;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue