From f44f70acd82fa665c318db433602cf812678c3ec Mon Sep 17 00:00:00 2001 From: Nash Tsai Date: Fri, 6 Dec 2013 15:19:48 +0800 Subject: [PATCH] add nil value filter for buildConditions --- statement.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/statement.go b/statement.go index 90837a3b..060c64ae 100644 --- a/statement.go +++ b/statement.go @@ -344,6 +344,10 @@ func buildConditions(engine *Engine, table *Table, bean interface{}, includeVers } else { continue } + case reflect.Ptr: + if fieldValue.IsNil() || !fieldValue.IsValid() { + continue + } default: val = fieldValue.Interface() }