Browse Source

bug fixed

xormplus 9 năm trước cách đây
mục cha
commit
85f0814a2a
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      helpers.go

+ 4 - 0
helpers.go

@@ -148,6 +148,10 @@ func isZero(k interface{}) bool {
 }
 
 func isStructZero(v reflect.Value) bool {
+	if !v.IsValid() {
+		return true
+	}
+
 	for i := 0; i < v.NumField(); i++ {
 		field := v.Field(i)
 		switch field.Kind() {