Commit 84240b7
fix: guard against null entries in LLM extraction response (#338)
When the LLM returns malformed JSON with null entries in the memories
array (e.g. {memories: [null, {...}]}), accessing raw.category throws:
TypeError: Cannot read properties of null (reading 'category')
This crash was observed in production (7 occurrences across multiple
days), causing the entire auto-capture pipeline to fail silently.
Add a null/type guard at the top of the candidate processing loop to
skip invalid entries gracefully instead of crashing.
Fixes capture failures logged as:
memory-lancedb-pro: capture failed: TypeError: Cannot read
properties of null (reading 'category')
Co-authored-by: dingguagua996-stack <dingguagua996@users.noreply.github.com>1 parent 4878abd commit 84240b7
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
404 | 411 | | |
405 | 412 | | |
406 | 413 | | |
| |||
0 commit comments