SearchController: fix null pointer exception when missing query data