Invert the condition to have a single return.

Thanks to David Blaikie for the suggestion.