Skip to content

Commit d4717b8

Browse files
committed
Verify attached before showing a dialog
Bug: 6372828 Change-Id: I7f3360ab8a0cdcaf20829e6e2c9181c7af73586e
1 parent d7247c7 commit d4717b8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/java/android/webkit/WebViewClassic.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8243,6 +8243,12 @@ public void onChanged() {
82438243

82448244
@Override
82458245
public void run() {
8246+
if (mWebViewCore == null
8247+
|| getWebView().getWindowToken() == null
8248+
|| getWebView().getViewRootImpl() == null) {
8249+
// We've been detached and/or destroyed since this was posted
8250+
return;
8251+
}
82468252
final ListView listView = (ListView) LayoutInflater.from(mContext)
82478253
.inflate(com.android.internal.R.layout.select_dialog, null);
82488254
final MyArrayListAdapter adapter = new MyArrayListAdapter();

0 commit comments

Comments
 (0)