This commit is contained in:
Lunny Xiao 2021-06-08 19:15:21 +08:00
parent c4f8c17d71
commit 515a0ff4ce
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 1 additions and 1 deletions

View File

@ -168,7 +168,7 @@ func (session *Session) Delete(beans ...interface{}) (int64, error) {
var realSQL string
argsForCache := make([]interface{}, 0, len(condArgs)*2)
if session.statement.GetUnscoped() || table.DeletedColumn() == nil { // tag "deleted" is disabled
if session.statement.GetUnscoped() || table == nil || table.DeletedColumn() == nil { // tag "deleted" is disabled
realSQL = deleteSQL
copy(argsForCache, condArgs)
argsForCache = append(condArgs, argsForCache...)