prevent invalid characters in searchers of persisted files from breaking the loading process. Related to GitHub issue #45

This commit is contained in:
Zlatin Balevsky
2020-05-08 17:33:57 +01:00
parent a6eca11479
commit e1bf6c0821

View File

@ -121,8 +121,13 @@ abstract class BasePersisterService extends Service{
if (json.searchers != null) {
json.searchers.each {
Persona searcher = null
if (it.searcher != null)
searcher = new Persona(new ByteArrayInputStream(Base64.decode(it.searcher)))
if (it.searcher != null) {
try {
searcher = new Persona(new ByteArrayInputStream(Base64.decode(it.searcher)))
} catch (Exception ignore) {
return
}
}
long timestamp = it.timestamp
String query = it.query
sf.hit(searcher, timestamp, query)