mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 395708: handle invalid IDs passed to nsIDownloadManagerUI::show (makes clicking on the "download complete" notification work when the download manager isn't open), r=sdwilsh
This commit is contained in:
parent
c1b55b8a66
commit
9d7c6a0d55
@ -72,12 +72,18 @@ nsDownloadManagerUI.prototype = {
|
||||
window = aWindowContext.getInterface(Ci.nsIDOMWindow);
|
||||
} catch (e) { /* it's OK to not have a parent window */ }
|
||||
|
||||
// We pass the download manager and the nsIDownload we want selected
|
||||
// We pass the download manager and the nsIDownload we want selected (if any)
|
||||
var params = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
|
||||
var dm = Cc["@mozilla.org/download-manager;1"].
|
||||
getService(Ci.nsIDownloadManager);
|
||||
params.appendElement(dm, false);
|
||||
params.appendElement(dm.getDownload(aID), false);
|
||||
|
||||
// Don't fail if our passed in ID is invalid
|
||||
var download = null;
|
||||
try {
|
||||
download = dm.getDownload(aID);
|
||||
} catch (ex) {}
|
||||
params.appendElement(download, false);
|
||||
|
||||
var ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
|
||||
getService(Ci.nsIWindowWatcher);
|
||||
|
@ -126,6 +126,7 @@ nsDownloadScanner::FindCLSID()
|
||||
}
|
||||
ULONG nReceived;
|
||||
clsidEnumerator->Next(1, &mScannerCLSID, &nReceived);
|
||||
clsidEnumerator->Next(1, &mScannerCLSID, &nReceived);
|
||||
if (nReceived == 0) {
|
||||
// No installed Anti Virus program
|
||||
return -3;
|
||||
|
Loading…
Reference in New Issue
Block a user