diff --git a/toolkit/mozapps/downloads/content/nsHelperAppDlg.js b/toolkit/mozapps/downloads/content/nsHelperAppDlg.js index 017a6844235..94b153e117d 100755 --- a/toolkit/mozapps/downloads/content/nsHelperAppDlg.js +++ b/toolkit/mozapps/downloads/content/nsHelperAppDlg.js @@ -377,9 +377,16 @@ nsUnknownContentTypeDialog.prototype = { var typeString = mimeInfo.Description; if (typeString == "") { - // 2. If there is none, use the extension to identify the file, e.g. "ZIP file" - if (mimeInfo.primaryExtension != "") - typeString = mimeInfo.primaryExtension.toUpperCase() + " file"; + // 2. If there is none, use the extension to identify the file, e.g. "ZIP file" + var primaryExtension = ""; + try { + primaryExtension = mimeInfo.primaryExtension; + } + catch (ex) { + } + + if (primaryExtension != "") + typeString = primaryExtension.toUpperCase() + " file"; // 3. If we can't even do that, just give up and show the MIME type. else typeString = mimeInfo.MIMEType;