From 4b629cf25804fd74712b0f7acce1c2e59135b9bf Mon Sep 17 00:00:00 2001 From: Tony Mantler Date: Fri, 15 Nov 2013 12:43:40 -0800 Subject: [PATCH] Null check certificate alias before trying to configure it Bug: 11678638 Change-Id: Ia12789ac3553ef959a8c9bbf13f017b1a154f560 --- .../emailcommon/utility/EmailClientConnectionManager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/emailcommon/src/com/android/emailcommon/utility/EmailClientConnectionManager.java b/emailcommon/src/com/android/emailcommon/utility/EmailClientConnectionManager.java index a275a12fd..ca0c21aab 100644 --- a/emailcommon/src/com/android/emailcommon/utility/EmailClientConnectionManager.java +++ b/emailcommon/src/com/android/emailcommon/utility/EmailClientConnectionManager.java @@ -18,6 +18,7 @@ package com.android.emailcommon.utility; import android.content.Context; +import android.text.TextUtils; import com.android.emailcommon.Logging; import com.android.emailcommon.provider.HostAuth; @@ -90,6 +91,9 @@ public class EmailClientConnectionManager extends ThreadSafeClientConnManager { */ public synchronized void registerClientCert(Context context, HostAuth hostAuth) throws CertificateException { + if (TextUtils.isEmpty(hostAuth.mClientCertAlias)) { + return; + } SchemeRegistry registry = getSchemeRegistry(); String schemeName = makeSchemeForClientCert(hostAuth.mClientCertAlias, hostAuth.shouldTrustAllServerCerts());