yjp hai 4 meses
pai
achega
655eae079c
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      framework/core/domain/object.go

+ 3 - 3
framework/core/domain/object.go

@@ -83,7 +83,7 @@ func CheckFieldsForUpdate(object Object, fieldMap map[string]string) error {
 			return false
 		}
 
-		if fieldValue.IsNil() {
+		if fieldValue.Kind() == reflect.Pointer && fieldValue.IsNil() {
 			return false
 		}
 
@@ -115,8 +115,8 @@ func Check(object Object, fieldMap map[string]string) error {
 // 返回值:
 // - 错误
 func CheckField(object Object, fieldName string, fieldMap map[string]string) error {
-	err := check.Struct(object, fieldMap).CheckFieldWhen("", func(fieldName string) bool {
-		if fieldName == fieldName {
+	err := check.Struct(object, fieldMap).CheckFieldWhen("", func(fn string) bool {
+		if fieldName == fn {
 			return true
 		}