From f33248aa4f05e57d7f105538f0f5465a0847085c Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 20 Mar 2018 20:19:44 -0400 Subject: [PATCH] crash fixes --- src/Android/Services/DeviceActionService.cs | 14 +++++++------- src/App/Models/Page/VaultViewCipherPageModel.cs | 5 +++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Android/Services/DeviceActionService.cs b/src/Android/Services/DeviceActionService.cs index db3d833c6..48509380f 100644 --- a/src/Android/Services/DeviceActionService.cs +++ b/src/Android/Services/DeviceActionService.cs @@ -487,15 +487,15 @@ namespace Bit.Android.Services { InputType = global::Android.Text.InputTypes.ClassText }; - if(text != null) + + if(text == null) { - input.Text = text; - input.SetSelection(text.Length); - } - else - { - input.FocusedByDefault = true; + text = string.Empty; } + + input.Text = text; + input.SetSelection(text.Length); + alertBuilder.SetView(input); var result = new TaskCompletionSource(); diff --git a/src/App/Models/Page/VaultViewCipherPageModel.cs b/src/App/Models/Page/VaultViewCipherPageModel.cs index 9d5e10b7d..c5831ab48 100644 --- a/src/App/Models/Page/VaultViewCipherPageModel.cs +++ b/src/App/Models/Page/VaultViewCipherPageModel.cs @@ -676,8 +676,9 @@ namespace Bit.App.Models.Page } } public string Label => IsWebsite ? AppResources.Website : AppResources.URI; - public bool IsWebsite => Value.StartsWith("http://") || Value.StartsWith("https://"); - public bool IsApp => Value.StartsWith(Constants.AndroidAppProtocol); + public bool IsWebsite => Value == null ? false : + Value.StartsWith("http://") || Value.StartsWith("https://"); + public bool IsApp => Value == null ? false : Value.StartsWith(Constants.AndroidAppProtocol); } } }