mirror of
https://github.com/Drop-OSS/drop-app
synced 2026-08-27 22:23:04 -04:00
fix(download manager): don't crash download manager if multiple errors
come in
This commit is contained in:
parent
cfc9d13cad
commit
21204dee69
1 changed files with 6 additions and 6 deletions
|
|
@ -284,14 +284,14 @@ impl DownloadManagerBuilder {
|
|||
}
|
||||
fn manage_error_signal(&mut self, error: ApplicationDownloadError) {
|
||||
debug!("got signal Error");
|
||||
let current_agent = self.current_download_agent.clone().unwrap();
|
||||
if let Some(current_agent) = self.current_download_agent.clone() {
|
||||
current_agent.on_error(&self.app_handle, error.clone());
|
||||
|
||||
current_agent.on_error(&self.app_handle, error.clone());
|
||||
self.stop_and_wait_current_download();
|
||||
self.remove_and_cleanup_front_download(¤t_agent.metadata());
|
||||
|
||||
self.stop_and_wait_current_download();
|
||||
self.remove_and_cleanup_front_download(¤t_agent.metadata());
|
||||
|
||||
self.set_status(DownloadManagerStatus::Error(error));
|
||||
self.set_status(DownloadManagerStatus::Error(error));
|
||||
}
|
||||
}
|
||||
fn manage_cancel_signal(&mut self, meta: &DownloadableMetadata) {
|
||||
debug!("got signal Cancel");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue