Added an undefined check on options for search queries.