Skip to content

Commit d3d0194

Browse files
authored
fix: dry run of assertions failing (#1778)
1 parent 4015b05 commit d3d0194

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cli/api/commands/run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ export class Runner {
424424
if (task.type === "assertion") {
425425
// We expect that an assertion query returns 1 row, with 1 field that is the row count.
426426
// We don't really care what that field/column is called.
427-
const rowCount = rows[0][Object.keys(rows[0])[0]];
427+
const rowCount = rows[0]?.[Object.keys(rows[0])[0]];
428428
if (rowCount > 0) {
429429
throw new Error(`Assertion failed: query returned ${rowCount} row(s).`);
430430
}

0 commit comments

Comments
 (0)