Commit a75434d
committed
fix: guard json.loads() in JSON tensor parsing to prevent crash on malformed/missing values
Two unguarded json.loads() calls in _conversions.py would raise JSONDecodeError
or TypeError when a JSON tensor's value field is None or not valid JSON.
Also added a None-name guard to avoid silently inserting None keys into the
output dict.
Affected functions:
- convert_to_model_output (event-based output path)
- convert_array_to_model_output (array-based output path)1 parent 940432c commit a75434d
1 file changed
Lines changed: 18 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
160 | 168 | | |
161 | 169 | | |
162 | 170 | | |
| |||
203 | 211 | | |
204 | 212 | | |
205 | 213 | | |
206 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
207 | 223 | | |
208 | 224 | | |
209 | 225 | | |
| |||
0 commit comments