Raise an error when type == Integer but nil is passed