summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2010-12-10 11:51:54 -0800
committerMichael Kolb <kolby@google.com>2010-12-10 12:51:57 -0800
commitb6bc32c9c6ed3ec90d602a729a7bfa7741896cf4 (patch)
tree0edd56ba8927414fcf4105d4d132ff619cea78b4 /src/com/android/browser
parente3e90c23337166065b1f68be7d82434df89b0691 (diff)
downloadpackages_apps_Browser-b6bc32c9c6ed3ec90d602a729a7bfa7741896cf4.zip
packages_apps_Browser-b6bc32c9c6ed3ec90d602a729a7bfa7741896cf4.tar.gz
packages_apps_Browser-b6bc32c9c6ed3ec90d602a729a7bfa7741896cf4.tar.bz2
Fix NPE in onDismiss
Bug: http://b/issue?id=3224622 Checking WebView added Change-Id: I809a8bdcd94589981876cf4d566fd8825b850a87
Diffstat (limited to 'src/com/android/browser')
-rw-r--r--src/com/android/browser/TitleBarXLarge.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/com/android/browser/TitleBarXLarge.java b/src/com/android/browser/TitleBarXLarge.java
index 5326280..99e86c4 100644
--- a/src/com/android/browser/TitleBarXLarge.java
+++ b/src/com/android/browser/TitleBarXLarge.java
@@ -33,6 +33,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnFocusChangeListener;
+import android.webkit.WebView;
import android.widget.ImageView;
/**
@@ -186,10 +187,16 @@ public class TitleBarXLarge extends TitleBarBase
@Override
public void onDismiss() {
- mUiController.getCurrentTopWebView().requestFocus();
+ WebView top = mUiController.getCurrentTopWebView();
+ if (top != null) {
+ mUiController.getCurrentTopWebView().requestFocus();
+ }
((BaseUi) mUiController.getUi()).hideFakeTitleBar();
setUrlMode(false);
- setDisplayTitle(mUiController.getCurrentWebView().getUrl());
+ // if top != null current must be set
+ if (top != null) {
+ setDisplayTitle(mUiController.getCurrentWebView().getUrl());
+ }
}
@Override