mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
* Addded null check on bookmark before operating on it
This commit is contained in:
parent
fbf7cd505a
commit
01f6c999ca
1 changed files with 5 additions and 4 deletions
|
|
@ -6,17 +6,14 @@ import android.database.Cursor;
|
|||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.os.RemoteException;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import fr.free.nrw.commons.bookmarks.Bookmark;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Provider;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import fr.free.nrw.commons.bookmarks.Bookmark;
|
||||
|
||||
import static fr.free.nrw.commons.bookmarks.pictures.BookmarkPicturesContentProvider.BASE_URI;
|
||||
|
||||
@Singleton
|
||||
|
|
@ -121,6 +118,10 @@ public class BookmarkPicturesDao {
|
|||
* @return boolean : is bookmark in database ?
|
||||
*/
|
||||
public boolean findBookmark(Bookmark bookmark) {
|
||||
if (bookmark == null) {//Avoiding NPE's
|
||||
return false;
|
||||
}
|
||||
|
||||
Cursor cursor = null;
|
||||
ContentProviderClient db = clientProvider.get();
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue