mirror of
https://github.com/bitwarden/mobile.git
synced 2024-11-26 12:16:07 +01:00
handle some crash cases
This commit is contained in:
parent
05d6f5d806
commit
3415be4c56
@ -122,8 +122,8 @@ namespace Bit.Android
|
||||
root.Dispose();
|
||||
e.Dispose();
|
||||
}
|
||||
// Some unknown condition is causing NullReferenceException's in production. Suppress it for now.
|
||||
catch(NullReferenceException) { }
|
||||
// Suppress exceptions so that service doesn't crash
|
||||
catch { }
|
||||
}
|
||||
|
||||
public override void OnInterrupt()
|
||||
|
@ -15,13 +15,13 @@ namespace Bit.App.Repositories
|
||||
|
||||
public Task<IEnumerable<LoginData>> GetAllByUserIdAsync(string userId)
|
||||
{
|
||||
var logins = Connection.Table<LoginData>().Where(f => f.UserId == userId).Cast<LoginData>();
|
||||
var logins = Connection.Table<LoginData>().Where(l => l.UserId == userId).Cast<LoginData>();
|
||||
return Task.FromResult(logins);
|
||||
}
|
||||
|
||||
public Task<IEnumerable<LoginData>> GetAllByUserIdAsync(string userId, bool favorite)
|
||||
{
|
||||
var logins = Connection.Table<LoginData>().Where(f => f.UserId == userId && f.Favorite == favorite)
|
||||
var logins = Connection.Table<LoginData>().Where(l => l.UserId == userId && l.Favorite == favorite)
|
||||
.Cast<LoginData>();
|
||||
return Task.FromResult(logins);
|
||||
}
|
||||
|
@ -304,7 +304,10 @@ namespace Bit.App.Services
|
||||
return;
|
||||
}
|
||||
|
||||
var localFolders = (await _folderRepository.GetAllByUserIdAsync(_authService.UserId).ConfigureAwait(false))
|
||||
var localFolders = (await _folderRepository.GetAllByUserIdAsync(_authService.UserId)
|
||||
.ConfigureAwait(false))
|
||||
.GroupBy(f => f.Id)
|
||||
.Select(f => f.First())
|
||||
.ToDictionary(f => f.Id);
|
||||
|
||||
foreach(var serverFolder in serverFolders)
|
||||
@ -339,7 +342,10 @@ namespace Bit.App.Services
|
||||
return;
|
||||
}
|
||||
|
||||
var localLogins = (await _loginRepository.GetAllByUserIdAsync(_authService.UserId).ConfigureAwait(false))
|
||||
var localLogins = (await _loginRepository.GetAllByUserIdAsync(_authService.UserId)
|
||||
.ConfigureAwait(false))
|
||||
.GroupBy(s => s.Id)
|
||||
.Select(s => s.First())
|
||||
.ToDictionary(s => s.Id);
|
||||
|
||||
foreach(var serverLogin in serverLogins)
|
||||
|
Loading…
Reference in New Issue
Block a user