mirror of https://github.com/zlatinb/muwire
do not transmit path information if there is none
parent
1fa27f4ab7
commit
4e28e6020b
|
@ -136,7 +136,7 @@ class ResultsParser {
|
||||||
uuid: uuid,
|
uuid: uuid,
|
||||||
certificates : certificates,
|
certificates : certificates,
|
||||||
collections : collections,
|
collections : collections,
|
||||||
path: path.toArray(new String[0]))
|
path: path.isEmpty() ? null : path.toArray(new String[0]))
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new InvalidSearchResultException("parsing search result failed",e)
|
throw new InvalidSearchResultException("parsing search result failed",e)
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,9 +210,13 @@ class ResultsSender {
|
||||||
if (showPaths) {
|
if (showPaths) {
|
||||||
List<String> path = new ArrayList<>()
|
List<String> path = new ArrayList<>()
|
||||||
if (sf.getPathToSharedParent() != null) {
|
if (sf.getPathToSharedParent() != null) {
|
||||||
for (Path element : sf.getPathToSharedParent())
|
for (Path element : sf.getPathToSharedParent()) {
|
||||||
path << Base64.encode(DataUtil.encodei18nString(element.toString()))
|
String toString = element.toString()
|
||||||
|
if (!toString.isEmpty())
|
||||||
|
path << Base64.encode(DataUtil.encodei18nString(toString))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (!path.isEmpty())
|
||||||
obj.path = path
|
obj.path = path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue