Bug 1031429 - Fix NPE by adding a NULL check. r=bnicholson
authorSwaroop Rao <swaroop.rao@gmail.com>
Tue, 09 Dec 2014 09:19:00 -0500
changeset 251921 f526a385989aa1d31b4a677fd412b461389f1020
parent 251920 ae9cc9b5f5dda503e877a55b54ad1ca40484a18e
child 251922 11942c706677d9e96d11f8e184f253125c325fda
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbnicholson
bugs1031429
milestone38.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 1031429 - Fix NPE by adding a NULL check. r=bnicholson
mobile/android/base/FilePickerResultHandler.java
--- a/mobile/android/base/FilePickerResultHandler.java
+++ b/mobile/android/base/FilePickerResultHandler.java
@@ -245,17 +245,17 @@ class FilePickerResultHandler implements
         @Override
         public void onLoaderReset(Loader<Cursor> loader) { }
 
         /*Tabs.OnTabsChangedListener*/
         // This cleans up our temp file. If it doesn't run, we just hope that Android
         // will eventually does the cleanup for us.
         @Override
         public void onTabChanged(Tab tab, Tabs.TabEvents msg, Object data) {
-            if (tab.getId() != tabId) {
+            if ((tab == null) || (tab.getId() != tabId)) {
                 return;
             }
 
             if (msg == Tabs.TabEvents.LOCATION_CHANGE ||
                 msg == Tabs.TabEvents.CLOSED) {
                 ThreadUtils.postToBackgroundThread(new Runnable() {
                     @Override
                     public void run() {