prevent npe in keyword searches
This commit is contained in:
@@ -157,8 +157,11 @@ abstract class Connection implements Closeable {
|
|||||||
|
|
||||||
protected void handleSearch(def search) {
|
protected void handleSearch(def search) {
|
||||||
UUID uuid = UUID.fromString(search.uuid)
|
UUID uuid = UUID.fromString(search.uuid)
|
||||||
if (search.infohash != null)
|
byte [] infohash = null
|
||||||
|
if (search.infohash != null) {
|
||||||
search.keywords = null
|
search.keywords = null
|
||||||
|
infohash = Base64.decode(search.infohash)
|
||||||
|
}
|
||||||
|
|
||||||
Destination replyTo = new Destination(search.replyTo)
|
Destination replyTo = new Destination(search.replyTo)
|
||||||
TrustLevel trustLevel = trustService.getLevel(replyTo)
|
TrustLevel trustLevel = trustService.getLevel(replyTo)
|
||||||
@@ -182,7 +185,7 @@ abstract class Connection implements Closeable {
|
|||||||
|
|
||||||
|
|
||||||
SearchEvent searchEvent = new SearchEvent(searchTerms : search.keywords,
|
SearchEvent searchEvent = new SearchEvent(searchTerms : search.keywords,
|
||||||
searchHash : Base64.decode(search.infohash),
|
searchHash : infohash,
|
||||||
uuid : uuid)
|
uuid : uuid)
|
||||||
QueryEvent event = new QueryEvent ( searchEvent : searchEvent,
|
QueryEvent event = new QueryEvent ( searchEvent : searchEvent,
|
||||||
replyTo : replyTo,
|
replyTo : replyTo,
|
||||||
|
Reference in New Issue
Block a user