Skip to content
This repository was archived by the owner on Aug 5, 2023. It is now read-only.

Commit 2e767ce

Browse files
authored
fix a small bug that seldom leaded a crash
1 parent 4a017f5 commit 2e767ce

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/src/main/java/spacehunn/exploitr/deautherwebgui/MainActivity.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public void onReceive(Context c, Intent ix) {
249249
iFilter.addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION);
250250
getApplicationContext().registerReceiver(reaver, iFilter);
251251

252-
new AlertDialog.Builder(MainActivity.this)
252+
AlertDialog.Builder x = new AlertDialog.Builder(MainActivity.this)
253253
.setView(scanView)
254254
.setCancelable(false)
255255
.setNeutralButton("Help", new DialogInterface.OnClickListener() {
@@ -265,8 +265,10 @@ public void onClick(DialogInterface dialog, int which) {
265265
public void onClick(DialogInterface dialog, int which) {
266266
getApplicationContext().unregisterReceiver(reaver);
267267
}
268-
})
269-
.show();
268+
});
269+
if (!MainActivity.this.isFinishing()) {
270+
x.show();
271+
}
270272
}
271273

272274
@Override

0 commit comments

Comments
 (0)