Browse Source

For db update check id != 0 instead of id > 0.

Fixes an issue when the entry was saved with -1 in earlier stages of dev.
renovate/org.robolectric-robolectric-4.x
Ammar Githam 4 years ago
parent
commit
ace2688c8d
  1. 2
      app/src/main/java/awais/instagrabber/db/datasources/FavoriteDataSource.java

2
app/src/main/java/awais/instagrabber/db/datasources/FavoriteDataSource.java

@ -47,7 +47,7 @@ public class FavoriteDataSource {
}
public final void insertOrUpdateFavorite(@NonNull final Favorite favorite) {
if (favorite.getId() > 0) {
if (favorite.getId() != 0) {
favoriteDao.updateFavorites(favorite);
return;
}

Loading…
Cancel
Save