mirror of
https://github.com/bitwarden/mobile
synced 2025-12-23 03:33:59 +00:00
null checks
This commit is contained in:
@@ -26,21 +26,21 @@ namespace Bit.iOS.Core.Utilities
|
||||
}
|
||||
if (identities.Any())
|
||||
{
|
||||
await ASCredentialIdentityStore.SharedStore.ReplaceCredentialIdentitiesAsync(identities.ToArray());
|
||||
await ASCredentialIdentityStore.SharedStore?.ReplaceCredentialIdentitiesAsync(identities.ToArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task<bool> IdentitiesCanIncremental()
|
||||
{
|
||||
var state = await ASCredentialIdentityStore.SharedStore.GetCredentialIdentityStoreStateAsync();
|
||||
return state.Enabled && state.SupportsIncrementalUpdates;
|
||||
var state = await ASCredentialIdentityStore.SharedStore?.GetCredentialIdentityStoreStateAsync();
|
||||
return state != null && state.Enabled && state.SupportsIncrementalUpdates;
|
||||
}
|
||||
|
||||
public static async Task<bool> AutofillEnabled()
|
||||
{
|
||||
var state = await ASCredentialIdentityStore.SharedStore.GetCredentialIdentityStoreStateAsync();
|
||||
return state.Enabled;
|
||||
var state = await ASCredentialIdentityStore.SharedStore?.GetCredentialIdentityStoreStateAsync();
|
||||
return state != null && state.Enabled;
|
||||
}
|
||||
|
||||
public static async Task<ASPasswordCredentialIdentity> GetCipherIdentityAsync(string cipherId, ICipherService cipherService)
|
||||
|
||||
@@ -81,9 +81,9 @@ namespace Bit.iOS.Core.Views
|
||||
{
|
||||
searchFilter = searchFilter.ToLower();
|
||||
Items = _allItems
|
||||
.Where(s => s.Name.ToLower().Contains(searchFilter) ||
|
||||
.Where(s => s.Name?.ToLower().Contains(searchFilter) ?? false ||
|
||||
(s.Username?.ToLower().Contains(searchFilter) ?? false) ||
|
||||
(s.Uris?.FirstOrDefault()?.Uri.ToLower().Contains(searchFilter) ?? false))
|
||||
(s.Uris?.FirstOrDefault()?.Uri?.ToLower().Contains(searchFilter) ?? false))
|
||||
.TakeWhile(s => !ct.IsCancellationRequested)
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user