fix nil pointer

This commit is contained in:
yifhao 2018-10-17 12:57:00 +08:00 committed by Lunny Xiao
parent 56efc798ed
commit 12c4e66ca1
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 1 additions and 1 deletions

View File

@ -102,7 +102,7 @@ func (session *Session) Delete(bean interface{}) (int64, error) {
return 0, err return 0, err
} }
pLimitN := session.statement.LimitN pLimitN := session.statement.LimitN
if len(condSQL) == 0 && pLimitN == nil && *pLimitN == 0 { if len(condSQL) == 0 && (pLimitN == nil || *pLimitN == 0) {
return 0, ErrNeedDeletedCond return 0, ErrNeedDeletedCond
} }