refactor(alarms): harden ExtractTagAlarm severity parse (TryGetInt32) + trim projector prior-state (review nits)

This commit is contained in:
Joseph Doherty
2026-06-14 03:27:03 -04:00
parent 25c3bd16ba
commit 422e5b7db2
3 changed files with 5 additions and 8 deletions
@@ -666,7 +666,7 @@ public static class DeploymentArtifact
var type = a.TryGetProperty("alarmType", out var tEl) && tEl.ValueKind == JsonValueKind.String
? (tEl.GetString() ?? "AlarmCondition") : "AlarmCondition";
var sev = a.TryGetProperty("severity", out var sEl) && sEl.ValueKind == JsonValueKind.Number
? sEl.GetInt32() : 500;
&& sEl.TryGetInt32(out var sv) ? sv : 500;
return new EquipmentTagAlarmInfo(type, sev);
}
catch (JsonException) { return null; }