File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
app/src/main/java/fr/free/nrw/commons/bookmarks/pictures Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 66import android .database .sqlite .SQLiteDatabase ;
77import android .os .RemoteException ;
88import android .support .annotation .NonNull ;
9-
9+ import fr . free . nrw . commons . bookmarks . Bookmark ;
1010import java .util .ArrayList ;
1111import java .util .List ;
12-
1312import javax .inject .Inject ;
1413import javax .inject .Named ;
1514import javax .inject .Provider ;
1615import javax .inject .Singleton ;
1716
18- import fr .free .nrw .commons .bookmarks .Bookmark ;
19-
2017import static fr .free .nrw .commons .bookmarks .pictures .BookmarkPicturesContentProvider .BASE_URI ;
2118
2219@ Singleton
@@ -121,6 +118,10 @@ private void deleteBookmark(Bookmark bookmark) {
121118 * @return boolean : is bookmark in database ?
122119 */
123120 public boolean findBookmark (Bookmark bookmark ) {
121+ if (bookmark == null ) {//Avoiding NPE's
122+ return false ;
123+ }
124+
124125 Cursor cursor = null ;
125126 ContentProviderClient db = clientProvider .get ();
126127 try {
You can’t perform that action at this time.
0 commit comments