From 185e234ef276e6ce539f612c3b5264dd75af3c53 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 26 Aug 2016 19:23:59 -0400 Subject: [PATCH] Catch Date toString exceptions to resolve crashing --- src/App/Pages/Settings/SettingsSyncPage.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/App/Pages/Settings/SettingsSyncPage.cs b/src/App/Pages/Settings/SettingsSyncPage.cs index 0682a719e..a82b8fbd1 100644 --- a/src/App/Pages/Settings/SettingsSyncPage.cs +++ b/src/App/Pages/Settings/SettingsSyncPage.cs @@ -73,7 +73,16 @@ namespace Bit.App.Pages private void SetLastSync() { var lastSyncDate = _settings.GetValueOrDefault(Constants.LastSync); - LastSyncLabel.Text = "Last Sync: " + lastSyncDate?.ToLocalTime().ToString() ?? "Never"; + try + { + LastSyncLabel.Text = "Last Sync: " + lastSyncDate?.ToLocalTime().ToString() ?? "Never"; + } + catch + { + // some users with different calendars have issues with ToString()ing a date + // it seems the linker is at fault. just catch for now since this isn't that important. + // ref http://bit.ly/2c2JU7b + } } public async Task SyncAsync()