diff --git a/Duplicati/GUI/HelperControls/BackupFileList.cs b/Duplicati/GUI/HelperControls/BackupFileList.cs index 67d8f7af9..8e7543c9e 100644 --- a/Duplicati/GUI/HelperControls/BackupFileList.cs +++ b/Duplicati/GUI/HelperControls/BackupFileList.cs @@ -33,7 +33,6 @@ namespace Duplicati.GUI.HelperControls { private DateTime m_when; private List m_files; - private Exception m_exception; private Schedule m_schedule; private bool m_isInCheck = false; @@ -67,39 +66,32 @@ namespace Duplicati.GUI.HelperControls private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e) { - try + DuplicatiRunner r = new DuplicatiRunner(); + IList files = r.ListFiles (m_schedule, m_when); + if (backgroundWorker.CancellationPending) { - m_exception = null; - DuplicatiRunner r = new DuplicatiRunner(); - IList files = r.ListFiles (m_schedule, m_when); - if (backgroundWorker.CancellationPending) - { - e.Cancel = true; - return; - } - if (m_files != null) - { - m_files.Clear(); - m_files.AddRange(files); - } - else - m_files = new List(files); + e.Cancel = true; + return; } - catch (Exception ex) + + if (m_files != null) { - m_exception = ex; + m_files.Clear(); + m_files.AddRange(files); } + else + m_files = new List(files); } private void backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { treeView.Nodes.Clear(); - if (m_exception != null) + if (e != null && e.Error != null) { LoadingIndicator.Visible = true; treeView.Visible = false; progressBar.Visible = false; - LoadingIndicator.Text = m_exception.Message; + LoadingIndicator.Text = e.Error.Message; return; }