Fix the panic when no running environment.