Skip to content

Commit 33b0f95

Browse files
committed
cdctest/validator: handle error early
This commit properly handles errors from `rowDatums.FetchValKey`. Epic: none Release note: none
1 parent dec7e21 commit 33b0f95

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pkg/ccl/changefeedccl/cdctest/validator.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,14 +321,13 @@ func (v *beforeAfterValidator) checkRowAt(
321321
stmtBuf.WriteString(` AND `)
322322
}
323323
jsonCol, err := rowDatums.FetchValKey(col)
324-
324+
if err != nil {
325+
return err
326+
}
325327
if jsonCol == nil || jsonCol.Type() == json.NullJSONType {
326328
fmt.Fprintf(&stmtBuf, `%s IS NULL`, col)
327329
} else {
328330
fmt.Fprintf(&stmtBuf, `to_json(%s)::TEXT = $%d`, col, i+1)
329-
if err != nil {
330-
return err
331-
}
332331
args = append(args, jsonCol.String())
333332
}
334333
}

0 commit comments

Comments
 (0)