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

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

Issue 2476563002: bluetooth: Fix crash when accepting location permission (Closed)
Patch Set: Address juncai's comments Created 4 years, 1 month 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 | chrome/android/javatests/src/org/chromium/chrome/browser/BluetoothChooserDialogTest.java » ('j') | 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/BluetoothChooserDialog.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/BluetoothChooserDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/BluetoothChooserDialog.java
index 3d2289f72f0c2c0c2eab6654c7adfd8fb1cf3845..4e30d9bd9576dcfd1e9be861817cff331d685910 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/BluetoothChooserDialog.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/BluetoothChooserDialog.java
@@ -186,6 +186,11 @@ public class BluetoothChooserDialog
@Override
public void onRequestPermissionsResult(String[] permissions, int[] grantResults) {
+ // The chooser might have been closed during the request.
+ if (mNativeBluetoothChooserDialogPtr == 0) {
+ return;
+ }
+
for (int i = 0; i < permissions.length; i++) {
if (permissions[i].equals(Manifest.permission.ACCESS_COARSE_LOCATION)) {
if (checkLocationServicesAndPermission()) {
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/BluetoothChooserDialogTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698