From ace2688c8d1f0035b3807a3b08eb97713dea9c68 Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Wed, 24 Mar 2021 22:26:11 +0900 Subject: [PATCH] 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. --- .../awais/instagrabber/db/datasources/FavoriteDataSource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/awais/instagrabber/db/datasources/FavoriteDataSource.java b/app/src/main/java/awais/instagrabber/db/datasources/FavoriteDataSource.java index 36798b08..bc013926 100644 --- a/app/src/main/java/awais/instagrabber/db/datasources/FavoriteDataSource.java +++ b/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; }