db icon indicating copy to clipboard operation
db copied to clipboard

Unhandled error in select.go causes a nil pointer dereference

Open schneekatze opened this issue 2 years ago • 0 comments

In github.com/upper/db/[email protected]/internal/sqlbuilder/select.go:428 a possible error is ignored.

func (sel *selector) statement() *exql.Statement {
	sq, _ := sel.build()
	return sq.statement()
}

If an error takes place, sq can be nil, resulting into a panic "runtime error: invalid memory address or nil pointer dereference".

schneekatze avatar Feb 12 '24 10:02 schneekatze