OSDN Git Service

Prevent a null pointer exception.
authorLeon Scroggins III <scroggo@google.com>
Thu, 16 Sep 2010 19:30:15 +0000 (15:30 -0400)
committerLeon Scroggins III <scroggo@google.com>
Thu, 16 Sep 2010 19:30:15 +0000 (15:30 -0400)
Bug: 3004709
Change-Id: I0594f8725601cf0e99dd2809d3571af6bfe1a056

src/com/android/browser/BrowserActivity.java

index e98ab43..aca7003 100644 (file)
@@ -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.