Skip to content

Commit 12034e7

Browse files
nil checks
1 parent a51b3b3 commit 12034e7

File tree

1 file changed

+2
-2
lines changed
  • utils/serialization/maps

1 file changed

+2
-2
lines changed

utils/serialization/maps/map.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func toTime(f reflect.Type, t reflect.Type, data any) (any, error) {
152152
}
153153

154154
func toCustomTypeIntFallback(f reflect.Type, t reflect.Type, data any) (any, error) {
155-
if f.Kind() != reflect.String {
155+
if f == nil || t == nil || f.Kind() != reflect.String {
156156
return data, nil
157157
}
158158
if t.Kind() != reflect.Int {
@@ -176,7 +176,7 @@ func toCustomTypeIntFallback(f reflect.Type, t reflect.Type, data any) (any, err
176176
}
177177

178178
func toCustomType(f reflect.Type, t reflect.Type, data any) (any, error) {
179-
if f.Kind() != reflect.String {
179+
if f == nil || t == nil || f.Kind() != reflect.String {
180180
return data, nil
181181
}
182182

0 commit comments

Comments
 (0)