diff --git a/src/iOS.Autofill/CredentialProviderViewController.cs b/src/iOS.Autofill/CredentialProviderViewController.cs index bfa7cf93a..4de801bb2 100644 --- a/src/iOS.Autofill/CredentialProviderViewController.cs +++ b/src/iOS.Autofill/CredentialProviderViewController.cs @@ -54,7 +54,15 @@ namespace Bit.iOS.Autofill public override void PrepareCredentialList(ASCredentialServiceIdentifier[] serviceIdentifiers) { _context.ServiceIdentifiers = serviceIdentifiers; - _context.UrlString = serviceIdentifiers[0].Identifier; + if(serviceIdentifiers.Length > 0) + { + var uri = serviceIdentifiers[0].Identifier; + if(serviceIdentifiers[0].Type == ASCredentialServiceIdentifierType.Domain) + { + uri = string.Concat("https://", uri); + } + _context.UrlString = uri; + } if(!CheckAuthed()) { return; diff --git a/src/iOS.Core/Models/AppExtensionContext.cs b/src/iOS.Core/Models/AppExtensionContext.cs index f68f1ef5e..e55377fdc 100644 --- a/src/iOS.Core/Models/AppExtensionContext.cs +++ b/src/iOS.Core/Models/AppExtensionContext.cs @@ -28,7 +28,12 @@ namespace Bit.iOS.Core.Models set { _uriString = value; - if(_uriString != null && !_uriString.StartsWith(App.Constants.iOSAppProtocol) && _uriString.Contains(".")) + if(string.IsNullOrWhiteSpace(_uriString)) + { + return; + } + + if(!_uriString.StartsWith(App.Constants.iOSAppProtocol) && _uriString.Contains(".")) { if(!_uriString.Contains("://") && !_uriString.Contains(" ")) {