diff options
-rw-r--r-- | src/com/android/browser/BrowserActivity.java | 20 | ||||
-rw-r--r-- | src/com/android/browser/TabControl.java | 3 |
2 files changed, 16 insertions, 7 deletions
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index ad50a92..8681be2 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -4232,13 +4232,19 @@ public class BrowserActivity extends Activity AnimatingView(Context ctxt, TabControl.Tab t) { super(ctxt); mTab = t; - // Use the top window in the animation since the tab overview will - // display the top window in each cell. - final WebView w = t.getTopWindow(); - mPicture = w.capturePicture(); - mScale = w.getScale() / w.getWidth(); - mScrollX = w.getScrollX(); - mScrollY = w.getScrollY(); + if (t != null && t.getTopWindow() != null) { + // Use the top window in the animation since the tab overview + // will display the top window in each cell. + final WebView w = t.getTopWindow(); + mPicture = w.capturePicture(); + mScale = w.getScale() / w.getWidth(); + mScrollX = w.getScrollX(); + mScrollY = w.getScrollY(); + } else { + mPicture = null; + mScale = 1.0f; + mScrollX = mScrollY = 0; + } } @Override diff --git a/src/com/android/browser/TabControl.java b/src/com/android/browser/TabControl.java index ee63f2c..0cbef69 100644 --- a/src/com/android/browser/TabControl.java +++ b/src/com/android/browser/TabControl.java @@ -407,6 +407,9 @@ class TabControl { * @return index of Tab or -1 if not found */ int getTabIndex(Tab tab) { + if (tab == null) { + return -1; + } return mTabs.indexOf(tab); } |