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 1798a6497673
parent 88001 009ae02d3f97
child 88003 fad541ac48da
push id6624
push usermleibovic@mozilla.com
push date2012-02-29 21:26 +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);