Skip to content

Commit d62c33c

Browse files
committed
Added fix with checking model for nil.
1 parent d0cf67b commit d62c33c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

database/comment.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@ import (
88
)
99

1010
func MakeComments(ctx context.Context, sc SchemeCommenter, models ...interface{}) error {
11+
if models == nil {
12+
return nil
13+
}
14+
1115
for _, model := range models {
16+
if model == nil {
17+
continue
18+
}
19+
1220
modelType := reflect.TypeOf(model)
1321

1422
if reflect.ValueOf(model).Kind() == reflect.Ptr {

0 commit comments

Comments
 (0)