Move a redundant if statement up a level.