Bug 1265908 - Avoid NPE with empty selection r?grisha
It is possible and valid to have a null selection. All other manipulations
are null-safe, and we need to be able to handle the null-case when testing for
annotations being part of the selection.
MozReview-Commit-ID: Fpnt2NX1BmV
--- a/mobile/android/base/java/org/mozilla/gecko/db/BrowserProvider.java
+++ b/mobile/android/base/java/org/mozilla/gecko/db/BrowserProvider.java
@@ -999,17 +999,17 @@ public class BrowserProvider extends Sha
} else {
debug("Using sort order " + sortOrder + ".");
}
qb.setProjectionMap(BOOKMARKS_PROJECTION_MAP);
if (hasFaviconsInProjection(projection)) {
qb.setTables(VIEW_BOOKMARKS_WITH_FAVICONS);
- } else if (selection.contains(Bookmarks.ANNOTATION_KEY)) {
+ } else if (selection != null && selection.contains(Bookmarks.ANNOTATION_KEY)) {
qb.setTables(VIEW_BOOKMARKS_WITH_ANNOTATIONS);
groupBy = uri.getQueryParameter(BrowserContract.PARAM_GROUP_BY);
} else {
qb.setTables(TABLE_BOOKMARKS);
}
break;