Description

I have a crash when using the Table method : https://gorm.io/docs/conventions.html#Temporarily-specify-a-name

ERROR msg=runtime error: invalid memory address or nil pointer dereference: XXXXX
goroutine 68 [running]:
github.com/go-kratos/kratos/v2/middleware/recovery.Recovery.func2.1.1()
    /Users/perrie/go/pkg/mod/github.com/go-kratos/kratos/v2@v2.1.4/middleware/recovery/recovery.go:57 +0xbe
panic({0xccf020, 0x1a10730})
    /opt/homebrew/Cellar/go/1.17.6/libexec/src/runtime/panic.go:1038 +0x215
gorm.io/gorm.(*Statement).QuoteTo(0xc00038ec40, {0x13eca80, 0xc0002b2f20}, {0xc86e60, 0xc0002e91f0})
    /Users/perrie/go/pkg/mod/gorm.io/gorm@v1.22.5/statement.go:141 +0x626
gorm.io/gorm.(*Statement).Quote(...)
    /Users/perrie/go/pkg/mod/gorm.io/gorm@v1.22.5/statement.go:159
gorm.io/gorm.(*DB).Table(0xc00043e120, {0xc00030fda0, 0xdd345d}, {0x0, 0x0, 0x0})
    /Users/perrie/go/pkg/mod/gorm.io/gorm@v1.22.5/chainable_api.go:58 +0x375

I tried a few names : - companies_nasdaq : KO - companies-nasdaq : KO - companies nasdaq : OK

The statement var is nil on KO cases : https://github.com/go-gorm/gorm/blob/e5894ca44951fecc3b3f31f1aa46df7de6024b04/chainable_api.go#L58

Comment From: github-actions[bot]

The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 2 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking