don't check incoming repo URI is on same wifi if device does not have wifi
Fixes this crash: dalvikvm W threadid=1: thread exiting with uncaught exception (group=0xb68df4f0) AndroidRuntime E FATAL EXCEPTION: main E java.lang.RuntimeException: Unable to resume activity {org.fdroid.fdroid/org.fdroid.fdroid.views.ManageReposActivity}: java.lang.NullPointerException E at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2120) E at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2135) E at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1668) E at android.app.ActivityThread.access$1500(ActivityThread.java:117) E at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) E at android.os.Handler.dispatchMessage(Handler.java:99) E at android.os.Looper.loop(Looper.java:130) E at android.app.ActivityThread.main(ActivityThread.java:3683) E at java.lang.reflect.Method.invokeNative(Native Method) E at java.lang.reflect.Method.invoke(Method.java:507) E at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) E at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) E at dalvik.system.NativeStart.main(Native Method) E Caused by: java.lang.NullPointerException E at org.fdroid.fdroid.views.ManageReposActivity.checkIfNewRepoOnSameWifi(ManageReposActivity.java:466) E at org.fdroid.fdroid.views.ManageReposActivity.addRepoFromIntent(ManageReposActivity.java:455) E at org.fdroid.fdroid.views.ManageReposActivity.onResume(ManageReposActivity.java:144) E at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1150) E at android.app.Activity.performResume(Activity.java:3832) E at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2110) E ... 12 more
This commit is contained in:
parent
47d6bb095b
commit
0a10e44778
@ -463,7 +463,10 @@ public class ManageReposActivity extends ActionBarActivity {
|
||||
if (!TextUtils.isEmpty(newRepo.getBssid())) {
|
||||
WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
|
||||
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
|
||||
String bssid = wifiInfo.getBSSID().toLowerCase(Locale.ENGLISH);
|
||||
String bssid = wifiInfo.getBSSID();
|
||||
if (TextUtils.isEmpty(bssid)) /* not all devices have wifi */
|
||||
return;
|
||||
bssid = bssid.toLowerCase(Locale.ENGLISH);
|
||||
String newRepoBssid = Uri.decode(newRepo.getBssid()).toLowerCase(Locale.ENGLISH);
|
||||
if (!bssid.equals(newRepoBssid)) {
|
||||
String msg = String.format(getString(R.string.not_on_same_wifi), newRepo.getSsid());
|
||||
|
Loading…
x
Reference in New Issue
Block a user