diff options
author | Irfan Sheriff <isheriff@google.com> | 2013-04-19 19:43:46 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-04-19 19:43:46 +0000 |
commit | 4a1d95139a57b8726fb168b08a5c54b9a134c8df (patch) | |
tree | 4bf4dc6cd4c451c46414a66b6036f2cd8c917d51 /wifi | |
parent | e37c8f781abb045ec4a0b872e5e6afe48eee021a (diff) | |
parent | 0b4732c2248fa2b92a44f045dfcadb3547076ef4 (diff) | |
download | frameworks_base-4a1d95139a57b8726fb168b08a5c54b9a134c8df.zip frameworks_base-4a1d95139a57b8726fb168b08a5c54b9a134c8df.tar.gz frameworks_base-4a1d95139a57b8726fb168b08a5c54b9a134c8df.tar.bz2 |
Merge "Fix NPE issues seen by CTS" into jb-mr2-dev
Diffstat (limited to 'wifi')
-rw-r--r-- | wifi/java/android/net/wifi/WifiEnterpriseConfig.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java index e2512a4..6e3034b 100644 --- a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java +++ b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java @@ -412,10 +412,14 @@ public class WifiEnterpriseConfig implements Parcelable { * @throws IllegalArgumentException if not a CA certificate */ public void setCaCertificate(X509Certificate cert) { - if (cert.getBasicConstraints() >= 0) { - mCaCert = cert; + if (cert != null) { + if (cert.getBasicConstraints() >= 0) { + mCaCert = cert; + } else { + throw new IllegalArgumentException("Not a CA certificate"); + } } else { - throw new IllegalArgumentException("Not a CA certificate"); + 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) == '"')) { |