diff --git a/apps/api/src/proxmox/proxmox-normalize.ts b/apps/api/src/proxmox/proxmox-normalize.ts index a35222d..cbf8ecb 100644 --- a/apps/api/src/proxmox/proxmox-normalize.ts +++ b/apps/api/src/proxmox/proxmox-normalize.ts @@ -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 {