Skip to content

Commit

Permalink
Fix: SSID from a config can be null now
Browse files Browse the repository at this point in the history
  • Loading branch information
Saurabh Agrawal committed Aug 27, 2019
1 parent 6d4e5e1 commit d1ee148
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion android/src/main/java/com/tadasr/IOTWifi/IOTWifiModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,9 @@ private WifiConfiguration getExistingNetworkConfig(String ssid) {
String comparableSSID = ('"' + ssid + '"'); // Add quotes because wifiConfig.SSID has them
if (configList != null) {
for (WifiConfiguration wifiConfig : configList) {
if (wifiConfig.SSID.equals(comparableSSID)) {
String savedSSID = wifiConfig.SSID;
if (savedSSID == null) continue; // In few cases SSID is found to be null, ignore those configs
if (savedSSID.equals(comparableSSID)) {
Log.d("IoTWifi", "Found Matching Wifi: "+ wifiConfig.toString());
existingNetworkConfigForSSID = wifiConfig;
break;
Expand Down

0 comments on commit d1ee148

Please sign in to comment.