Commit b21fe0f5 authored by zauberstuhl's avatar zauberstuhl
Browse files

enforceOneRow does not cover zero rows

this leads to invalid memory address or nil pointer dereference
in later transactions
parent 31b24f75
......@@ -84,6 +84,9 @@ func enforceOneRow(r *sql.Rows, debugname string, fn func(r SingleRow) error) er
}
n++
}
if n == 0 {
return fmt.Errorf("%s: zero database rows retrieved when enforcing one row", debugname)
}
return r.Err()
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment