Skip to content
Snippets Groups Projects
Commit ddec988a authored by Johan de Klerk's avatar Johan de Klerk
Browse files

Check for nil model

parent 99a358c7
No related branches found
No related tags found
No related merge requests found
...@@ -67,6 +67,10 @@ func (d QueryHook) AfterQuery(_ context.Context, event *bun.QueryEvent) { ...@@ -67,6 +67,10 @@ func (d QueryHook) AfterQuery(_ context.Context, event *bun.QueryEvent) {
} }
func TableNameForQuery(event *bun.QueryEvent) string { func TableNameForQuery(event *bun.QueryEvent) string {
if event.Model == nil {
return ""
}
model := event.Model.Value() model := event.Model.Value()
if model == nil { if model == nil {
return "" return ""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment