Skip to content
Snippets Groups Projects
Unverified Commit ba353b9f authored by akwizgran's avatar akwizgran
Browse files

List of wifi configs can be null.

parent 7bc269fd
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@ import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.List;
import javax.annotation.concurrent.Immutable;
import javax.inject.Inject;
......@@ -49,8 +50,11 @@ class AndroidSecureRandomProvider extends LinuxSecureRandomProvider {
Parcel parcel = Parcel.obtain();
WifiManager wm =
(WifiManager) appContext.getSystemService(WIFI_SERVICE);
for (WifiConfiguration config : wm.getConfiguredNetworks())
parcel.writeParcelable(config, 0);
List<WifiConfiguration> configs = wm.getConfiguredNetworks();
if (configs != null) {
for (WifiConfiguration config : configs)
parcel.writeParcelable(config, 0);
}
BluetoothAdapter bt = BluetoothAdapter.getDefaultAdapter();
if (bt != null) {
for (BluetoothDevice device : bt.getBondedDevices())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment