Catch Date toString exceptions to resolve crashing

This commit is contained in:
Kyle Spearrin 2016-08-26 19:23:59 -04:00
parent aac4aafde0
commit 185e234ef2

View file

@ -73,8 +73,17 @@ namespace Bit.App.Pages
private void SetLastSync()
{
var lastSyncDate = _settings.GetValueOrDefault<DateTime?>(Constants.LastSync);
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()
{