Bug 731019 - java.lang.NullPointerException: at org.mozilla.gecko.AwesomeBarTabs.onBackPressed(AwesomeBarTabs.java). r=lucasr
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Wed, 29 Feb 2012 13:25:41 -0800
changeset 88002 1798a64976732cea3f04cff750d2291934e0821d
parent 88001 009ae02d3f9728e568de4a5147b651e80f91c5b8
child 88003 fad541ac48dad0b70cc1f6d86bc1823c9e798d2f
push id6624
push usermleibovic@mozilla.com
push dateWed, 29 Feb 2012 21:26:15 +0000
treeherdermozilla-inbound@fad541ac48da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr
bugs731019
milestone13.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 731019 - java.lang.NullPointerException: at org.mozilla.gecko.AwesomeBarTabs.onBackPressed(AwesomeBarTabs.java). r=lucasr
mobile/android/base/AwesomeBarTabs.java
--- a/mobile/android/base/AwesomeBarTabs.java
+++ b/mobile/android/base/AwesomeBarTabs.java
@@ -314,18 +314,20 @@ public class AwesomeBarTabs extends TabH
                 }
             }
         }
     }
 
     // This method checks to see if we're in a bookmark sub-folder. If we are,
     // it will go up a level and return true. Otherwise it will return false.
     public boolean onBackPressed() {
-        // If we're not in the bookmarks tab, we have nothing to do
-        if (!getCurrentTabTag().equals(BOOKMARKS_TAB))
+        // If we're not in the bookmarks tab, we have nothing to do. We should
+        // also return false if mBookmarksAdapter hasn't been initialized yet.
+        if (!getCurrentTabTag().equals(BOOKMARKS_TAB) ||
+                mBookmarksAdapter == null)
             return false;
 
         return mBookmarksAdapter.moveToParentFolder();
     }
 
     private class BookmarksQueryTask extends AsyncTask<Void, Void, Cursor> {
         protected Cursor doInBackground(Void... arg0) {
             return BrowserDB.getBookmarksInFolder(mContentResolver, Bookmarks.FIXED_ROOT_ID);