mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-27 12:05:30 +00:00
Catch possible exceptions when the receiver is already unregistered
This commit is contained in:
parent
d33b077a13
commit
c8fe0f5524
@ -116,7 +116,10 @@ public final class APKInstall {
|
||||
if (onFailure != null) {
|
||||
onFailure.run();
|
||||
}
|
||||
context.getApplicationContext().unregisterReceiver(this);
|
||||
try {
|
||||
context.getApplicationContext().unregisterReceiver(this);
|
||||
} catch (IllegalArgumentException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
latch.countDown();
|
||||
@ -126,7 +129,10 @@ public final class APKInstall {
|
||||
private void onSuccess(Context context) {
|
||||
if (onSuccess != null)
|
||||
onSuccess.run();
|
||||
context.getApplicationContext().unregisterReceiver(this);
|
||||
try {
|
||||
context.getApplicationContext().unregisterReceiver(this);
|
||||
} catch (IllegalArgumentException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user