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

Commit

Permalink
fix a small bug that seldom leaded a crash
Browse files Browse the repository at this point in the history
  • Loading branch information
ExploiTR authored Sep 5, 2017
1 parent 4a017f5 commit 2e767ce
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public void onReceive(Context c, Intent ix) {
iFilter.addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION);
getApplicationContext().registerReceiver(reaver, iFilter);

new AlertDialog.Builder(MainActivity.this)
AlertDialog.Builder x = new AlertDialog.Builder(MainActivity.this)
.setView(scanView)
.setCancelable(false)
.setNeutralButton("Help", new DialogInterface.OnClickListener() {
Expand All @@ -265,8 +265,10 @@ public void onClick(DialogInterface dialog, int which) {
public void onClick(DialogInterface dialog, int which) {
getApplicationContext().unregisterReceiver(reaver);
}
})
.show();
});
if (!MainActivity.this.isFinishing()) {
x.show();
}
}

@Override
Expand Down

0 comments on commit 2e767ce

Please sign in to comment.