Skip to content

Commit 02d7e48

Browse files
ChrisCraikAndroid (Google) Code Review
authored andcommitted
Merge "check for null ViewRootImpl" into jb-dev
2 parents c40db82 + a59558f commit 02d7e48

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/java/android/webkit/WebViewClassic.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
import android.view.ViewConfiguration;
8888
import android.view.ViewGroup;
8989
import android.view.ViewParent;
90+
import android.view.ViewRootImpl;
9091
import android.view.ViewTreeObserver;
9192
import android.view.WindowManager;
9293
import android.view.accessibility.AccessibilityEvent;
@@ -5435,8 +5436,9 @@ public void onDetachedFromWindow() {
54355436

54365437
if (mWebView.isHardwareAccelerated()) {
54375438
int drawGLFunction = nativeGetDrawGLFunction(mNativeClass);
5438-
if (drawGLFunction != 0) {
5439-
mWebView.getViewRootImpl().detachFunctor(drawGLFunction);
5439+
ViewRootImpl viewRoot = mWebView.getViewRootImpl();
5440+
if (drawGLFunction != 0 && viewRoot != null) {
5441+
viewRoot.detachFunctor(drawGLFunction);
54405442
}
54415443
}
54425444
}

0 commit comments

Comments
 (0)