react-native-iot-wifi icon indicating copy to clipboard operation
react-native-iot-wifi copied to clipboard

Attempt to invoke virtual method 'boolean java.lang.String.startsWith(java.lang.String)' on a null object reference in IOTWifiModule.java

Open nkovacic opened this issue 5 years ago • 4 comments

There is a potential null pointer issue in IOTWifiModule.java, where SSID could still be null if nInfo also returns null.

An additional check should be made: if (ssid != null && ssid.startsWith("\"") && ssid.endsWith("\"")) {ssid = ssid.substring(1, ssid.length() - 1); }

nkovacic avatar May 16 '19 10:05 nkovacic

@nkovacic could you create a pull request?

tadasr avatar May 17 '19 06:05 tadasr

Done #13.

nkovacic avatar May 17 '19 07:05 nkovacic

Nice @nkovacic, your PR fixes the issue for me. Not sure why, but it looks like this error appeared after upgrading my OS to Android 9 Pie. @tadasr any idea when this PR could be merged ? Further info: If fixes the unexpected crash, however it now doesn't return any wifi SSID :) Thank you!

madclem avatar Jul 03 '19 16:07 madclem

@madclem I submitted this PR to fix the Android Q issue https://github.com/tadasr/react-native-iot-wifi/pull/17

saurabytes avatar Aug 27 '19 23:08 saurabytes