Commit b3e86cd
committed
fix: tolerate null values when normalizing cast payload maps
deepNormalizeJson's fallback rebuilt the map via raw.entries, which throws on a
CastMap<String, Object>: the call sites pass `.cast<String, Object>()` over a
JSON-decoded payload that legitimately holds null fields, and reading a null
through the non-nullable Object cast raises "type 'Null' is not a subtype of
type 'Object'". The jsonEncode fast path above fails the same way, so a single
null field aborted the whole Chat/Attachment parse and dropped the event.
Rebuild key-by-key with a guarded per-value lookup so a null can't blow up the
normalize.1 parent 1c65d59 commit b3e86cd
1 file changed
Lines changed: 17 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
25 | 37 | | |
26 | 38 | | |
27 | 39 | | |
| |||
0 commit comments