Prevent dialog from invalid context

Bug: 6346748

Change-Id: Ia65ecc1ecb882b480127aca0034db25a9e51ed3c
This commit is contained in:
Michael Kolb
2012-04-18 08:37:41 -07:00
parent 32f038deab
commit dfceaf2cdb

View File

@@ -16,6 +16,7 @@
package android.webkit;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
@@ -146,6 +147,7 @@ class WebCoreThreadWatchdog implements Runnable {
break;
case TIMED_OUT:
if ((mContext == null) || !(mContext instanceof Activity)) return;
new AlertDialog.Builder(mContext)
.setMessage(com.android.internal.R.string.webpage_unresponsive)
.setPositiveButton(com.android.internal.R.string.force_close,