Skip to content

Commit

Permalink
Bug 825992 - Safeguard against null closing AboutHome with a null top…
Browse files Browse the repository at this point in the history
… sites adapter. r=mfinkle
  • Loading branch information
Wes Johnston committed Jan 2, 2013
1 parent 5ca9e10 commit 93e0ada
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mobile/android/base/AboutHomeContent.java
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,11 @@ public void onDestroy() {
mAccountListener = null;
}

Cursor cursor = mTopSitesAdapter.getCursor();
if (cursor != null && !cursor.isClosed())
cursor.close();

if (mTopSitesAdapter != null) {
Cursor cursor = mTopSitesAdapter.getCursor();
if (cursor != null && !cursor.isClosed())
cursor.close();
}
}

void setLastTabsVisibility(boolean visible) {
Expand Down
1 change: 1 addition & 0 deletions mobile/android/base/db/BrowserDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ public void setPinnedSites(Cursor c) {
String title = c.getString(c.getColumnIndex(URLColumns.TITLE));
mPinnedSites.put(pos, new PinnedSite(title, url));
} while (c.moveToNext());
c.close();
}
}

Expand Down

0 comments on commit 93e0ada

Please sign in to comment.