Throw an illegal use exception for format==null.