diff --git a/sqle/server/auditplan/job_task_handler.go b/sqle/server/auditplan/job_task_handler.go index e112a6122..4c34cdaa1 100644 --- a/sqle/server/auditplan/job_task_handler.go +++ b/sqle/server/auditplan/job_task_handler.go @@ -106,7 +106,11 @@ func BatchAuditSQLs(l *logrus.Entry, sqlList []*model.SQLManageRecord) ([]*model } } mu.Lock() - auditedSQLs = append(auditedSQLs, resp.AuditedSqls...) + if resp != nil { + auditedSQLs = append(auditedSQLs, resp.AuditedSqls...) + } else { + auditedSQLs = append(auditedSQLs, sqls...) + } mu.Unlock() }(sqls) }