Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Commit d1ee148

Browse files
author
Saurabh Agrawal
committed
Fix: SSID from a config can be null now
1 parent 6d4e5e1 commit d1ee148

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

android/src/main/java/com/tadasr/IOTWifi/IOTWifiModule.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,9 @@ private WifiConfiguration getExistingNetworkConfig(String ssid) {
267267
String comparableSSID = ('"' + ssid + '"'); // Add quotes because wifiConfig.SSID has them
268268
if (configList != null) {
269269
for (WifiConfiguration wifiConfig : configList) {
270-
if (wifiConfig.SSID.equals(comparableSSID)) {
270+
String savedSSID = wifiConfig.SSID;
271+
if (savedSSID == null) continue; // In few cases SSID is found to be null, ignore those configs
272+
if (savedSSID.equals(comparableSSID)) {
271273
Log.d("IoTWifi", "Found Matching Wifi: "+ wifiConfig.toString());
272274
existingNetworkConfigForSSID = wifiConfig;
273275
break;

0 commit comments

Comments
 (0)