We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4015b05 commit d3d0194Copy full SHA for d3d0194
1 file changed
cli/api/commands/run.ts
@@ -424,7 +424,7 @@ export class Runner {
424
if (task.type === "assertion") {
425
// We expect that an assertion query returns 1 row, with 1 field that is the row count.
426
// We don't really care what that field/column is called.
427
- const rowCount = rows[0][Object.keys(rows[0])[0]];
+ const rowCount = rows[0]?.[Object.keys(rows[0])[0]];
428
if (rowCount > 0) {
429
throw new Error(`Assertion failed: query returned ${rowCount} row(s).`);
430
}
0 commit comments