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

Commit 0b4732c2 authored by Irfan Sheriff's avatar Irfan Sheriff
Browse files

Fix NPE issues seen by CTS

Bug: 8646305
Change-Id: Ief90c76d63f60aee9a3da080cd43dd9610f3f4fc
parent 40843589
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -417,11 +417,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;
        }
    }

    /**
@@ -683,6 +687,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) == '"')) {