react-native-iot-wifi
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
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 could you create a pull request?
Done #13.
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 I submitted this PR to fix the Android Q issue https://github.com/tadasr/react-native-iot-wifi/pull/17