From df5f3826dde62c30995ceec22f549f3978640777 Mon Sep 17 00:00:00 2001 From: cgeek <cem.moreau@gmail.com> Date: Sat, 14 Jul 2018 15:24:46 +0200 Subject: [PATCH] [fix] trimming was corrupting Duniter's behavior on null checks (for implicit revocation) --- app/lib/indexer.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/lib/indexer.ts b/app/lib/indexer.ts index 645c30782..96fd89a60 100644 --- a/app/lib/indexer.ts +++ b/app/lib/indexer.ts @@ -1970,6 +1970,9 @@ function reduce<T>(records: T[]): T { for (const k of keys) { if (record[k] !== undefined && record[k] !== null) { obj[k] = record[k]; + } else if (record[k] === null && obj[k] === undefined) { + // null overrides undefined + (obj[k] as any) = null } } return obj -- GitLab