From a3d35aec7cd2e6146d20efadf4c88b1a156d0e1b Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Thu, 22 Jan 2004 23:19:02 +0000 Subject: Make Cancel safe against non active downloads. * embed/mozilla/MozDownload.cpp: Make Cancel safe against non active downloads. --- embed/mozilla/MozDownload.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'embed/mozilla/MozDownload.cpp') diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp index 38b06d064..6808c0251 100644 --- a/embed/mozilla/MozDownload.cpp +++ b/embed/mozilla/MozDownload.cpp @@ -406,6 +406,12 @@ MozDownload::OnSecurityChange (nsIWebProgress *aWebProgress, nsIRequest *aReques void MozDownload::Cancel() { + if (mDownloadState != EPHY_DOWNLOAD_DOWNLOADING && + mDownloadState != EPHY_DOWNLOAD_PAUSED) + { + return; + } + if (mWebPersist) { mWebPersist->CancelSave (); -- cgit v1.2.3