diff --git a/core/src/main/groovy/com/muwire/core/search/ResultsParser.groovy b/core/src/main/groovy/com/muwire/core/search/ResultsParser.groovy index 3189eb1e..8be14be0 100644 --- a/core/src/main/groovy/com/muwire/core/search/ResultsParser.groovy +++ b/core/src/main/groovy/com/muwire/core/search/ResultsParser.groovy @@ -34,7 +34,7 @@ class ResultsParser { throw new InvalidSearchResultException("length missing") if (json.infohash == null) throw new InvalidSearchResultException("infohash missing") - if (json.pieceSize == null || json.pieceSize == 0) + if (json.pieceSize == null || json.pieceSize <= 0) throw new InvalidSearchResultException("pieceSize missing") if (!(json.hashList instanceof List)) throw new InvalidSearchResultException("hashlist not a list") @@ -75,7 +75,7 @@ class ResultsParser { throw new InvalidSearchResultException("length missing") if (json.infohash == null) throw new InvalidSearchResultException("infohash missing") - if (json.pieceSize == null || json.pieceSize) + if (json.pieceSize == null || json.pieceSize <= 0) throw new InvalidSearchResultException("pieceSize missing") if (json.hashList != null) throw new InvalidSearchResultException("V2 result with hashlist")