mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 18:38:27 +03:00
null checks
This commit is contained in:
parent
480f954433
commit
2637587cf7
3 changed files with 6 additions and 6 deletions
|
@ -202,9 +202,9 @@ namespace Bit.Core.Services
|
||||||
Keys_LocalData);
|
Keys_LocalData);
|
||||||
var ciphers = await _storageService.GetAsync<Dictionary<string, CipherData>>(
|
var ciphers = await _storageService.GetAsync<Dictionary<string, CipherData>>(
|
||||||
string.Format(Keys_CiphersFormat, userId));
|
string.Format(Keys_CiphersFormat, userId));
|
||||||
var response = ciphers.Select(c => new Cipher(c.Value, false,
|
var response = ciphers?.Select(c => new Cipher(c.Value, false,
|
||||||
localData?.ContainsKey(c.Key) ?? false ? localData[c.Key] : null));
|
localData?.ContainsKey(c.Key) ?? false ? localData[c.Key] : null));
|
||||||
return response.ToList();
|
return response?.ToList() ?? new List<Cipher>();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: sequentialize?
|
// TODO: sequentialize?
|
||||||
|
|
|
@ -93,8 +93,8 @@ namespace Bit.Core.Services
|
||||||
var userId = await _userService.GetUserIdAsync();
|
var userId = await _userService.GetUserIdAsync();
|
||||||
var collections = await _storageService.GetAsync<Dictionary<string, CollectionData>>(
|
var collections = await _storageService.GetAsync<Dictionary<string, CollectionData>>(
|
||||||
string.Format(Keys_CollectionsFormat, userId));
|
string.Format(Keys_CollectionsFormat, userId));
|
||||||
var response = collections.Select(c => new Collection(c.Value));
|
var response = collections?.Select(c => new Collection(c.Value));
|
||||||
return response.ToList();
|
return response?.ToList() ?? new List<Collection>();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: sequentialize?
|
// TODO: sequentialize?
|
||||||
|
|
|
@ -75,8 +75,8 @@ namespace Bit.Core.Services
|
||||||
var userId = await _userService.GetUserIdAsync();
|
var userId = await _userService.GetUserIdAsync();
|
||||||
var folders = await _storageService.GetAsync<Dictionary<string, FolderData>>(
|
var folders = await _storageService.GetAsync<Dictionary<string, FolderData>>(
|
||||||
string.Format(Keys_CiphersFormat, userId));
|
string.Format(Keys_CiphersFormat, userId));
|
||||||
var response = folders.Select(f => new Folder(f.Value));
|
var response = folders?.Select(f => new Folder(f.Value));
|
||||||
return response.ToList();
|
return response?.ToList() ?? new List<Folder>();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: sequentialize?
|
// TODO: sequentialize?
|
||||||
|
|
Loading…
Reference in a new issue