Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1603)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java

Issue 2826213002: Prevent possible crash unregistering VR BroadcastReceiver (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java
index a6b95d0bbad074ebf4f62a7a6f8777136179223b..12629870dc2b0462e70aff9eee2dc6f36bbbee66 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java
@@ -157,7 +157,11 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
public void unregister() {
ChromeActivity activity = mTargetActivity.get();
if (activity == null) return;
- activity.unregisterReceiver(VrBroadcastReceiver.this);
+ try {
+ activity.unregisterReceiver(VrBroadcastReceiver.this);
+ } catch (IllegalArgumentException e) {
+ // Ignore this. This means our receiver was already unregistered somehow.
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698