浏览代码

bug fixed

xormplus 9 年之前
父节点
当前提交
85f0814a2a
共有 1 个文件被更改,包括 4 次插入0 次删除
  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() {