Merge the two consecutive if(!query) clauses.