Browse Source

bug fixed

xormplus 9 years ago
parent
commit
85f0814a2a
1 changed files with 4 additions and 0 deletions
  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() {