Yes, `env == null` should be removed.  Thanks.