Skip to content

Commit

Permalink
internal/server/helpers.go fix a bug in isVariant() where v.Elem() wa…
Browse files Browse the repository at this point in the history
…s called on non interface/pointer
  • Loading branch information
pnx committed May 28, 2024
1 parent 634205a commit ea5b2b8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/server/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,10 @@ func isVariant(v reflect.Value) bool {
return false
}

if !isVariantName(v.Index(0).Elem().String()) {
return false
for v = v.Index(0); v.Kind() == reflect.Interface || v.Kind() == reflect.Pointer; v = v.Elem() {
}

return true
return v.Kind() == reflect.String && isVariantName(v.String())
}

func parseTableDeltaData(v any) (map[string]interface{}, error) {
Expand Down

0 comments on commit ea5b2b8

Please sign in to comment.