From 430cb42d14b3ac194112f6e27c4ab4e82c60c3a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Thu, 3 Oct 2013 18:49:03 +0200 Subject: [PATCH] Fix crash when a new app appeared in the index --- src/org/fdroid/fdroid/DB.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/org/fdroid/fdroid/DB.java b/src/org/fdroid/fdroid/DB.java index c0f1505a5..682385f3c 100644 --- a/src/org/fdroid/fdroid/DB.java +++ b/src/org/fdroid/fdroid/DB.java @@ -124,7 +124,7 @@ public class DB { compatible = false; ignoreUpdates = false; filtered = false; - iconUrl = null; + iconUrl = null; } // True when all the detail fields are populated, False otherwise. @@ -1127,7 +1127,14 @@ public class DB { values.put("antiFeatures", CommaSeparatedList.str(upapp.antiFeatures)); values.put("requirements", CommaSeparatedList.str(upapp.requirements)); values.put("compatible", upapp.compatible ? 1 : 0); - values.put("ignoreUpdates", oldapp.ignoreUpdates ? 1 : 0); + + // Values to keep if already present + if (oldapp == null) { + values.put("ignoreUpdates", upapp.ignoreUpdates ? 1 : 0); + } else { + values.put("ignoreUpdates", oldapp.ignoreUpdates ? 1 : 0); + } + if (oldapp != null) { db.update(TABLE_APP, values, "id = ?", new String[] { oldapp.id }); } else {