Merge "Fix NPE issues seen by CTS" into jb-mr2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
4a1d95139a
@@ -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) == '"')) {
|
||||
|
||||
Reference in New Issue
Block a user