You don't actually need to check this – if there isn't a parameter, this route will never get hit.

(Note: even if you did have to check it, I would flip the conditional so the shorter case is first and returns early)