Skip to content

Commit 23a2ce1

Browse files
Michael KolbAndroid (Google) Code Review
authored andcommitted
Merge "Prevent dialog from invalid context"
2 parents 3cdfcdc + dfceaf2 commit 23a2ce1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/java/android/webkit/WebCoreThreadWatchdog.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package android.webkit;
1818

19+
import android.app.Activity;
1920
import android.app.AlertDialog;
2021
import android.content.Context;
2122
import android.content.DialogInterface;
@@ -146,6 +147,7 @@ public void handleMessage(Message msg) {
146147
break;
147148

148149
case TIMED_OUT:
150+
if ((mContext == null) || !(mContext instanceof Activity)) return;
149151
new AlertDialog.Builder(mContext)
150152
.setMessage(com.android.internal.R.string.webpage_unresponsive)
151153
.setPositiveButton(com.android.internal.R.string.force_close,

0 commit comments

Comments
 (0)