Skip to content
Snippets Groups Projects
Commit df5f3826 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[fix] trimming was corrupting Duniter's behavior on null checks (for implicit revocation)

parent 80951882
No related branches found
No related tags found
No related merge requests found
...@@ -1970,6 +1970,9 @@ function reduce<T>(records: T[]): T { ...@@ -1970,6 +1970,9 @@ function reduce<T>(records: T[]): T {
for (const k of keys) { for (const k of keys) {
if (record[k] !== undefined && record[k] !== null) { if (record[k] !== undefined && record[k] !== null) {
obj[k] = record[k]; obj[k] = record[k];
} else if (record[k] === null && obj[k] === undefined) {
// null overrides undefined
(obj[k] as any) = null
} }
} }
return obj return obj
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment