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

Unified Diff: ui/platform_window/android/platform_window_android.cc

Issue 1487123002: Platform Window: Fixing null checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing feedback. Created 5 years 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 | « ui/platform_window/android/platform_ime_controller_android.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/platform_window/android/platform_window_android.cc
diff --git a/ui/platform_window/android/platform_window_android.cc b/ui/platform_window/android/platform_window_android.cc
index b9ee051960584a63515a696ba1539c95002dec92..0cfdc6bf8504e06f67ff6fd03f1ec7e036572ff3 100644
--- a/ui/platform_window/android/platform_window_android.cc
+++ b/ui/platform_window/android/platform_window_android.cc
@@ -62,10 +62,11 @@ PlatformWindowAndroid::PlatformWindowAndroid(PlatformWindowDelegate* delegate)
PlatformWindowAndroid::~PlatformWindowAndroid() {
if (window_)
ReleaseWindow();
- if (!java_platform_window_android_.is_empty()) {
- JNIEnv* env = base::android::AttachCurrentThread();
- Java_PlatformWindowAndroid_detach(
- env, java_platform_window_android_.get(env).obj());
+ JNIEnv* env = base::android::AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> scoped_obj =
+ java_platform_window_android_.get(env);
+ if (!scoped_obj.is_null()) {
+ Java_PlatformWindowAndroid_detach(env, scoped_obj.obj());
}
}
« no previous file with comments | « ui/platform_window/android/platform_ime_controller_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698