Throw an exception if the mandatory id parameter is null