prevent unregisterReceiver if not registered (#387)

This commit is contained in:
m2049r 2018-08-12 13:31:25 +02:00 committed by GitHub
parent 5aded68c53
commit 6a2de36578
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -1276,7 +1276,10 @@ public class LoginActivity extends BaseActivity
BroadcastReceiver detachReceiver; BroadcastReceiver detachReceiver;
private void unregisterDetachReceiver() { private void unregisterDetachReceiver() {
if (detachReceiver != null) unregisterReceiver(detachReceiver); if (detachReceiver != null) {
unregisterReceiver(detachReceiver);
detachReceiver = null;
}
} }
private void registerDetachReceiver() { private void registerDetachReceiver() {