Fix crash when a new app appeared in the index
This commit is contained in:
parent
2650508999
commit
430cb42d14
@ -124,7 +124,7 @@ public class DB {
|
|||||||
compatible = false;
|
compatible = false;
|
||||||
ignoreUpdates = false;
|
ignoreUpdates = false;
|
||||||
filtered = false;
|
filtered = false;
|
||||||
iconUrl = null;
|
iconUrl = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// True when all the detail fields are populated, False otherwise.
|
// 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("antiFeatures", CommaSeparatedList.str(upapp.antiFeatures));
|
||||||
values.put("requirements", CommaSeparatedList.str(upapp.requirements));
|
values.put("requirements", CommaSeparatedList.str(upapp.requirements));
|
||||||
values.put("compatible", upapp.compatible ? 1 : 0);
|
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) {
|
if (oldapp != null) {
|
||||||
db.update(TABLE_APP, values, "id = ?", new String[] { oldapp.id });
|
db.update(TABLE_APP, values, "id = ?", new String[] { oldapp.id });
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user