fix(260923-le6): PMG-Summe null bei fehlendem Teilwert

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-23 15:30:58 +02:00
parent c13d657e41
commit 2eb86e14ea
+6 -2
View File
@@ -237,9 +237,13 @@ function emptyPmgMetrics(): ProxmoxPmgMetrics {
return { productType: 'pmg', countIn: null, countOut: null, spamCount: null, virusCount: null };
}
// Eine Tageszahl aus zwei Teilwerten ist nur dann bekannt, wenn beide
// Teilwerte bekannt sind; eine Teilsumme saehe vollstaendig aus, waere
// aber still falsch (Abnahmebefund 260923-dhh, Wahrheit 7; PMG-Feldnamen
// sind nur Annahme A5).
function sumOrNull(a: number | null, b: number | null): number | null {
if (a === null && b === null) return null;
return (a ?? 0) + (b ?? 0);
if (a === null || b === null) return null;
return a + b;
}
export function normalizePmg(body: unknown): NormalizeResult<ProxmoxPmgMetrics> {