Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a1d9513 authored by Irfan Sheriff's avatar Irfan Sheriff Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE issues seen by CTS" into jb-mr2-dev

parents e37c8f78 0b4732c2
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -412,11 +412,15 @@ public class WifiEnterpriseConfig implements Parcelable {
     * @throws IllegalArgumentException if not a CA certificate
     */
    public void setCaCertificate(X509Certificate cert) {
        if (cert != null) {
            if (cert.getBasicConstraints() >= 0) {
                mCaCert = cert;
            } else {
                throw new IllegalArgumentException("Not a CA certificate");
            }
        } else {
            mCaCert = null;
        }
    }

    /**
@@ -679,6 +683,7 @@ public class WifiEnterpriseConfig implements Parcelable {
    }

    private String removeDoubleQuotes(String string) {
        if (TextUtils.isEmpty(string)) return "";
        int length = string.length();
        if ((length > 1) && (string.charAt(0) == '"')
                && (string.charAt(length - 1) == '"')) {