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.
This commit is contained in:
Peter Serwylo 2017-03-08 13:04:22 +11:00
parent 40643855c4
commit 517321356d

View File

@ -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<String> pathParts = uri.getPathSegments();
String packageName = pathParts.get(2);
long repoId = Long.parseLong(pathParts.get(1));