From 517321356d2bd34d95b9577e521b975839b5bba1 Mon Sep 17 00:00:00 2001 From: Peter Serwylo Date: Wed, 8 Mar 2017 13:04:22 +1100 Subject: [PATCH] the database does not support null Description index-v1 does not send empty values. The description was historically set to "No description available" on the server side, and in index.xml. The database then inherited this behavior, and does not support no description. In the long run, it would be good to sync up the database with the index-v1 metadata, but perhasp then we'd have to add a million null guards, which wouldn't be worth it. --- .../main/java/org/fdroid/fdroid/data/TempAppProvider.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/org/fdroid/fdroid/data/TempAppProvider.java b/app/src/main/java/org/fdroid/fdroid/data/TempAppProvider.java index 296861008..9c9daba22 100644 --- a/app/src/main/java/org/fdroid/fdroid/data/TempAppProvider.java +++ b/app/src/main/java/org/fdroid/fdroid/data/TempAppProvider.java @@ -153,6 +153,11 @@ public class TempAppProvider extends AppProvider { throw new UnsupportedOperationException("Update not supported for " + uri + "."); } + if (values.containsKey(Cols.DESCRIPTION) && values.getAsString(Cols.DESCRIPTION) == null) { + // the database does not let a description be set as null + values.put(Cols.DESCRIPTION, ""); + } + List pathParts = uri.getPathSegments(); String packageName = pathParts.get(2); long repoId = Long.parseLong(pathParts.get(1));