mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-08-12 07:16:51 +00:00
fix: address PR #69 review feedback
- VmService.ExecuteGuestCommand: guard against null elements in -Args. The old JSON-serialization tolerated nulls (as "null"); the repeated-key path would NRE in EncodeFormValue. Throw a clear ArgumentException instead. - findings.json: refresh the stale counters block (untouched since F085) to the actual ledger state — next_id 92, resolved 83 — and bump last_updated to 2026-05-22. last_scan_date stays 2026-03-26 (F086–F091 came from issue triage, not a formal review scan). - VmServiceTests: add empty-array (single command entry) and null-element (throws) cases. Note: F091 is the correct next ID — F086–F090 already exist from prior merged PRs (#60/#61/#66/#67); only the counters were lagging. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -610,7 +610,11 @@ namespace PSProxmoxVE.Core.Services
|
||||
if (args != null)
|
||||
{
|
||||
foreach (var arg in args)
|
||||
{
|
||||
if (arg == null)
|
||||
throw new ArgumentException("Args elements must not be null.", nameof(args));
|
||||
data.Add(new KeyValuePair<string, string>("command", arg));
|
||||
}
|
||||
}
|
||||
|
||||
var response = client.PostAsync($"nodes/{Uri.EscapeDataString(node)}/qemu/{vmid}/agent/exec", data)
|
||||
|
||||
Reference in New Issue
Block a user