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

Commit 4b6909c9 authored by Irfan Sheriff's avatar Irfan Sheriff Committed by Android Git Automerger
Browse files

am d87bb312: am 4a1d9513: Merge "Fix NPE issues seen by CTS" into jb-mr2-dev

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


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


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