Skip to content

Commit

Permalink
fix: panic when refer nil of executeSQL.BackupTask.ID
Browse files Browse the repository at this point in the history
  • Loading branch information
winfredLIN committed Dec 3, 2024
1 parent cabc7fb commit 3047712
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sqle/server/sqled.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,13 +486,13 @@ func (a *action) backupAndExecSql() error {
for _, executeSQL := range a.task.ExecuteSQLs {
backupTask, err := toBackupTask(a.plugin, executeSQL, a.task.DBType)
if err != nil {
return fmt.Errorf("in backupAndExecSql when convert toBackupTask, err %w , backup task: %v, task: %v", err, executeSQL.BackupTask.ID, a.task.ID)
return fmt.Errorf("in backupAndExecSql when convert toBackupTask, err %w , backup task: %v, task: %v", err, backupTask, a.task.ID)
}
if err = backupTask.Backup(); err != nil {
return fmt.Errorf("in backupAndExecSql when backupTask Backup, err %w, backup task: %v, task: %v", err, executeSQL.BackupTask.ID, a.task.ID)
return fmt.Errorf("in backupAndExecSql when backupTask Backup, err %w, backup task: %v, task: %v", err, backupTask, a.task.ID)
}
if err := a.execSQL(executeSQL); err != nil {
return fmt.Errorf("in backupAndExecSql when execSQL %v, err %w, backup task: %v, task: %v", executeSQL, err, executeSQL.BackupTask.ID, a.task.ID)
return fmt.Errorf("in backupAndExecSql when execSQL %v, err %w, backup task: %v, task: %v", executeSQL, err, backupTask, a.task.ID)
}
}
return nil
Expand Down

0 comments on commit 3047712

Please sign in to comment.