Fix NPE in SearchContext.toString()

Fixes NPE in SearchContext.toString() for user requests that contain scroll id but not scroll timeout.
This commit is contained in:
Igor Motov 2016-10-20 15:43:08 -10:00
parent 8cc22eb960
commit 04c7665432
1 changed files with 5 additions and 1 deletions

View File

@ -397,7 +397,11 @@ public abstract class SearchContext extends AbstractRefCounted implements Releas
result.append("searchType=[").append(searchType()).append("]"); result.append("searchType=[").append(searchType()).append("]");
} }
if (scrollContext() != null) { if (scrollContext() != null) {
result.append("scroll=[").append(scrollContext().scroll.keepAlive()).append("]"); if (scrollContext().scroll != null) {
result.append("scroll=[").append(scrollContext().scroll.keepAlive()).append("]");
} else {
result.append("scroll=[null]");
}
} }
result.append(" query=[").append(query()).append("]"); result.append(" query=[").append(query()).append("]");
return result.toString(); return result.toString();