only close env if it exists (otherwise we get bad stack traces when construction fails)
only close env if it exists (otherwise we get bad stack traces when construction fails)

Farama-Foundation/Gymnasium,Farama-Foundation/Gymnasium