diff --git a/mongox/base/getprotection.go b/mongox/base/getprotection.go index 12ca266..1a51479 100644 --- a/mongox/base/getprotection.go +++ b/mongox/base/getprotection.go @@ -19,6 +19,9 @@ func GetProtection(source interface{}) *protection.Key { for i := 0; i < numField; i++ { field := el.Field(i) + if !field.CanInterface() { + continue + } switch field.Interface().(type) { case *protection.Key: