You should catch this exception explicitly around the block where it might occur (after retrieving the candidate set).