Repository navigation
Commit 5a91a98
Handle empty (null) query result without crashing
stackql emits the literal `null` for a query that matches no rows. assertResult
parsed that to null and then read `.length` on it, throwing
"Cannot read properties of null (reading 'length')" instead of reporting a
clean assertion failure. Normalise a non-array parsed result to an empty array
so a 0-rows-vs-expected case fails with a readable message. Adds coverage.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent cf5b39e commit 5a91a98
2 files changed
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
188 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
189 | 200 | | |
190 | 201 | | |
0 commit comments