mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 18:08:26 +03:00
null checks
This commit is contained in:
parent
d4cd2b8be8
commit
29b2d67fb6
2 changed files with 5 additions and 3 deletions
|
@ -140,14 +140,14 @@ namespace Bit.Android
|
||||||
{
|
{
|
||||||
var isPremium = Resolver.Resolve<ITokenService>()?.TokenPremium ?? false;
|
var isPremium = Resolver.Resolve<ITokenService>()?.TokenPremium ?? false;
|
||||||
var autoCopyEnabled = !_settings.GetValueOrDefault(Constants.SettingDisableTotpCopy, false);
|
var autoCopyEnabled = !_settings.GetValueOrDefault(Constants.SettingDisableTotpCopy, false);
|
||||||
if(isPremium && autoCopyEnabled && _deviceActionService != null && cipher.LoginTotp.Value != null)
|
if(isPremium && autoCopyEnabled && _deviceActionService != null && cipher.LoginTotp?.Value != null)
|
||||||
{
|
{
|
||||||
_deviceActionService.CopyToClipboard(App.Utilities.Crypto.Totp(cipher.LoginTotp.Value));
|
_deviceActionService.CopyToClipboard(App.Utilities.Crypto.Totp(cipher.LoginTotp.Value));
|
||||||
}
|
}
|
||||||
|
|
||||||
data.PutExtra("uri", cipher.LoginUri);
|
data.PutExtra("uri", cipher.LoginUri);
|
||||||
data.PutExtra("username", cipher.LoginUsername);
|
data.PutExtra("username", cipher.LoginUsername);
|
||||||
data.PutExtra("password", cipher.LoginPassword.Value);
|
data.PutExtra("password", cipher.LoginPassword?.Value ?? null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Parent == null)
|
if(Parent == null)
|
||||||
|
|
|
@ -218,7 +218,9 @@ namespace Bit.App.Pages
|
||||||
{
|
{
|
||||||
searchFilter = searchFilter.ToLower();
|
searchFilter = searchFilter.ToLower();
|
||||||
var filteredCiphers = Ciphers
|
var filteredCiphers = Ciphers
|
||||||
.Where(s => s.Name.ToLower().Contains(searchFilter) || s.Subtitle.ToLower().Contains(searchFilter))
|
.Where(s =>
|
||||||
|
s.Name.ToLower().Contains(searchFilter) ||
|
||||||
|
(s.Subtitle?.ToLower().Contains(searchFilter) ?? false))
|
||||||
.TakeWhile(s => !ct.IsCancellationRequested)
|
.TakeWhile(s => !ct.IsCancellationRequested)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue