diff --git a/nsxt/resource_nsxt_upgrade_run.go b/nsxt/resource_nsxt_upgrade_run.go index c48e05a08..4f0d6b468 100644 --- a/nsxt/resource_nsxt_upgrade_run.go +++ b/nsxt/resource_nsxt_upgrade_run.go @@ -90,6 +90,9 @@ func getTargetVersion(m interface{}) (string, error) { if err != nil { return "", err } + if obj.TargetVersion == nil { + return "", fmt.Errorf("failed to fetch upgrade target version. Upgrade process should be restarted with a clean state") + } return *obj.TargetVersion, nil }