If this is a mandatory parameter (please check as per comment below), and you move it to the URL pattern, then you no longer will need this check