1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-21 11:25:56 +01:00

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