From a9e35b6e3101fafb07e6bb4282e7dfc4dcfdc193 Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Thu, 16 Sep 2010 15:30:15 -0400 Subject: Prevent a null pointer exception. Bug: 3004709 Change-Id: I0594f8725601cf0e99dd2809d3571af6bfe1a056 --- src/com/android/browser/BrowserActivity.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index e98ab43..aca7003 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -3737,11 +3737,15 @@ public class BrowserActivity extends Activity // Nothing to do. return; } + Tab t = mTabControl.getCurrentTab(); + if (t == null) { + // There is no current tab so we cannot toggle the error console + return; + } mShouldShowErrorConsole = flag; - ErrorConsoleView errorConsole = mTabControl.getCurrentTab() - .getErrorConsole(true); + ErrorConsoleView errorConsole = t.getErrorConsole(true); if (flag) { // Setting the show state of the console will cause it's the layout to be inflated. -- cgit v1.1