From 28977a8df1048b5d754472e01fad7b5b0c6b228b Mon Sep 17 00:00:00 2001 From: "gavin%gavinsharp.com" Date: Sun, 9 Apr 2006 21:10:51 +0000 Subject: [PATCH] Bug 308204: null description in helper version info leaves Download Actions blank, patch by Phil Ringnalda , r=mconnor --- browser/components/preferences/downloadactions.js | 13 +++++++++---- toolkit/mozapps/preferences/preferences.xml | 10 +++++++--- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/browser/components/preferences/downloadactions.js b/browser/components/preferences/downloadactions.js index 295e6faec7a4..93de421b6a34 100644 --- a/browser/components/preferences/downloadactions.js +++ b/browser/components/preferences/downloadactions.js @@ -283,15 +283,20 @@ var gDownloadActionsWindow = { _getDisplayNameForFile: function (aFile) { #ifdef XP_WIN - if (aFile instanceof Components.interfaces.nsILocalFileWin) - return aFile.getVersionInfoField("FileDescription"); -#else + if (aFile instanceof Components.interfaces.nsILocalFileWin) { + try { + return aFile.getVersionInfoField("FileDescription"); + } + catch (e) { + // fall through to the filename + } + } +#endif // XXXben - Read the bundle name on OS X. var ios = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var url = ios.newFileURI(aFile).QueryInterface(Components.interfaces.nsIURL); return url.fileName; -#endif }, _loadMIMERegistryData: function () diff --git a/toolkit/mozapps/preferences/preferences.xml b/toolkit/mozapps/preferences/preferences.xml index 8953b4e43099..71b6da5e3b73 100644 --- a/toolkit/mozapps/preferences/preferences.xml +++ b/toolkit/mozapps/preferences/preferences.xml @@ -51,14 +51,18 @@