Check for null exception on getSearchQuery