bun icon indicating copy to clipboard operation
bun copied to clipboard

fix: Rare panic in indirectAsKey (model_table_has_many.go) when loading complex models

Open warkanum opened this issue 1 month ago • 1 comments

In model_table_has_many.go, the indirectAsKey method has a nil pointer bug. Calling reflect.TypeOf(v).Kind() if v is nil causes a panic.

warkanum avatar Nov 20 '25 14:11 warkanum

Hi. It looks like the root cause here is an improper implementation of driver.Valuer. Could you elaborate on the circumstances under which this occurs?

Implementing a fix for this in the proposed way could inadvertently obscure issues and hinder the troubleshooting process for other incorrect driver.Valuer implementations down the line.

Aoang avatar Nov 26 '25 11:11 Aoang