fix: resolve net48-only nullable warnings (CS8601, CS8602, CS8604)

- CS8601: Add null-forgiving operator on guarded dictionary assignments
  in cmdlets where IsNullOrEmpty check precedes the assignment
- CS8602: Add Assert.NotNull after JObject["data"] in xUnit model tests
  (JToken indexer returns nullable on net48)
- CS8604: Add null-forgiving on guarded arguments in NodeService,
  WaitPveTaskCmdlet, GetPveTemplateCmdlet, and auth test parameters

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Clint Branham
2026-03-19 08:32:57 -05:00
parent 3075c12768
commit d187b0de52
26 changed files with 165 additions and 57 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ namespace PSProxmoxVE.Core.Services
var versionStr = data?["version"]?.ToString();
if (string.IsNullOrEmpty(versionStr))
throw new InvalidOperationException("Failed to retrieve PVE version from API response.");
return PveVersion.Parse(versionStr);
return PveVersion.Parse(versionStr!);
}
}
}