Commit cf3ddfc
authored
fix: prevent AttributeError when schema_dump receives None values (#530)
has_dict_attribute() was incorrectly returning True for None due to
protocol checking behavior, causing schema_dump(None) to fail with
AttributeError when trying to access None.__dict__.
This affected nullable database fields using StoredObject types during
JSON serialization. The fix adds an explicit None check before the
protocol isinstance check.
- Add explicit None check to has_dict_attribute()
- Add test case verifying None values are handled correctly1 parent 4698506 commit cf3ddfc
2 files changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
263 | | - | |
| 262 | + | |
| 263 | + | |
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
233 | 244 | | |
234 | 245 | | |
235 | 246 | | |
| |||
0 commit comments