Fixes #7024 - fixes delete cv from environment

In the cv api, this fixes the guard that checks that cv is in environment prior to removal.