Fix bug that allowed loading invalid indexes

If no -I flag was supplied and the index was corrupt,
the queryHandler was nullptr and that did not lead to immediate termination.