mirror of
https://github.com/bitwarden/android.git
synced 2025-01-12 11:17:30 +03:00
null checks
This commit is contained in:
parent
a0632bcac2
commit
09a1c17fb4
1 changed files with 10 additions and 2 deletions
|
@ -354,7 +354,15 @@ namespace Bit.Core.Services
|
||||||
}
|
}
|
||||||
var tasks = history.Select(async item =>
|
var tasks = history.Select(async item =>
|
||||||
{
|
{
|
||||||
|
if(item == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
var encrypted = await _cryptoService.EncryptAsync(item.Password);
|
var encrypted = await _cryptoService.EncryptAsync(item.Password);
|
||||||
|
if(encrypted == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return new GeneratedPasswordHistory
|
return new GeneratedPasswordHistory
|
||||||
{
|
{
|
||||||
Password = encrypted.EncryptedString,
|
Password = encrypted.EncryptedString,
|
||||||
|
@ -362,7 +370,7 @@ namespace Bit.Core.Services
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
var h = await Task.WhenAll(tasks);
|
var h = await Task.WhenAll(tasks);
|
||||||
return h.ToList();
|
return h.Where(x => x != null).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<List<GeneratedPasswordHistory>> DecryptHistoryAsync(List<GeneratedPasswordHistory> history)
|
private async Task<List<GeneratedPasswordHistory>> DecryptHistoryAsync(List<GeneratedPasswordHistory> history)
|
||||||
|
|
Loading…
Reference in a new issue