summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2017-02-09 00:25:23 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-02-09 00:25:28 +0000
commit5a0d21156d4b74cc2a0772701a17a84e8a5051ae (patch)
tree3d439225fffdd615e96c065cd1b88a0c979ee798 /core/java
parent0e09fddcd0d89520a9e99cbd1dd7970a7f93c86d (diff)
parente925aeacab9a9fb4637d2ec6d850bffa7228e050 (diff)
Merge "Check for null inputs in the ctor."
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/net/WifiKey.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/net/WifiKey.java b/core/java/android/net/WifiKey.java
index 99de99ece1e5..68b505d49da6 100644
--- a/core/java/android/net/WifiKey.java
+++ b/core/java/android/net/WifiKey.java
@@ -64,10 +64,10 @@ public class WifiKey implements Parcelable {
* @throws IllegalArgumentException if either the SSID or BSSID is invalid.
*/
public WifiKey(String ssid, String bssid) {
- if (!SSID_PATTERN.matcher(ssid).matches()) {
+ if (ssid == null || !SSID_PATTERN.matcher(ssid).matches()) {
throw new IllegalArgumentException("Invalid ssid: " + ssid);
}
- if (!BSSID_PATTERN.matcher(bssid).matches()) {
+ if (bssid == null || !BSSID_PATTERN.matcher(bssid).matches()) {
throw new IllegalArgumentException("Invalid bssid: " + bssid);
}
this.ssid = ssid;