From a90ea9d0a5b95b1b6e1dac8e650e27aadfb52a7b Mon Sep 17 00:00:00 2001 From: Reza Date: Mon, 21 Oct 2024 10:35:21 +0200 Subject: [PATCH] validators null fix --- lib/validation/validators.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/validation/validators.go b/lib/validation/validators.go index 72388fc..d2e06b0 100644 --- a/lib/validation/validators.go +++ b/lib/validation/validators.go @@ -160,7 +160,7 @@ func uniqueValidator(match []string, value *generic.Value, stmt *gorm.Statement, } func foreignKeyValidator(match []string, value *generic.Value, stmt *gorm.Statement, field *schema.Field) error { - if field.StructField.Type.Kind() == reflect.Ptr && value.String() == "" { + if field.StructField.Type.Kind() == reflect.Ptr && value.String() == "" && value.String() == "" { return nil } var c int64