do not transmit path information if there is none

auto-update
Zlatin Balevsky 2021-10-05 00:51:35 +01:00
parent 1fa27f4ab7
commit 4e28e6020b
No known key found for this signature in database
GPG Key ID: A72832072D525E41
2 changed files with 8 additions and 4 deletions

View File

@ -136,7 +136,7 @@ class ResultsParser {
uuid: uuid,
certificates : certificates,
collections : collections,
path: path.toArray(new String[0]))
path: path.isEmpty() ? null : path.toArray(new String[0]))
} catch (Exception e) {
throw new InvalidSearchResultException("parsing search result failed",e)
}

View File

@ -210,10 +210,14 @@ class ResultsSender {
if (showPaths) {
List<String> path = new ArrayList<>()
if (sf.getPathToSharedParent() != null) {
for (Path element : sf.getPathToSharedParent())
path << Base64.encode(DataUtil.encodei18nString(element.toString()))
for (Path element : sf.getPathToSharedParent()) {
String toString = element.toString()
if (!toString.isEmpty())
path << Base64.encode(DataUtil.encodei18nString(toString))
}
}
obj.path = path
if (!path.isEmpty())
obj.path = path
}
obj