From a93546ea5b65ba14c3dc053bd82c5ed1478c17aa Mon Sep 17 00:00:00 2001 From: "blakeross%telocity.com" Date: Sat, 9 Nov 2002 13:17:10 +0000 Subject: [PATCH] Fix crash trying to save without a default download dir --- browser/base/content/browser.js | 2 +- browser/base/content/contentAreaUtils.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 18a2c85df78a..1e4aa9ea9b69 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -315,7 +315,7 @@ function Startup() } } } - return; + setTimeout(delayedStartup, 0); } diff --git a/browser/base/content/contentAreaUtils.js b/browser/base/content/contentAreaUtils.js index 4d84bc58d6c3..1b93ae8dc5a9 100644 --- a/browser/base/content/contentAreaUtils.js +++ b/browser/base/content/contentAreaUtils.js @@ -161,8 +161,9 @@ function foundHeaderInfo(aSniffer, aData, aSkipPrompt) const nsILocalFile = Components.interfaces.nsILocalFile; const lfContractID = "@mozilla.org/file/local;1"; + var dir = null; try { - var dir = prefs.getComplexValue("dir", nsILocalFile); + dir = prefs.getComplexValue("dir", nsILocalFile); } catch (e) { } @@ -179,7 +180,8 @@ function foundHeaderInfo(aSniffer, aData, aSkipPrompt) appendFiltersForContentType(fp, contentType, isDocument ? MODE_COMPLETE : MODE_FILEONLY); - fp.displayDirectory = dir; + if (dir) + fp.displayDirectory = dir; if (isDocument) { try {