I like swapping these conditions so that error reporting is in the `else` block, making the code a bit clearer.