Null check certificate alias before trying to configure it

Bug: 11678638

Change-Id: Ia12789ac3553ef959a8c9bbf13f017b1a154f560
This commit is contained in:
Tony Mantler 2013-11-15 12:43:40 -08:00 committed by Yu Ping Hu
parent bc8bc050b0
commit 4b629cf258
1 changed files with 4 additions and 0 deletions

View File

@ -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());