From 672e109c676fc09a56902562719046e2773ca85d Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Tue, 16 Dec 2008 17:24:18 -0500 Subject: [PATCH] Fix joinPaths when stuff dun't exist --- common/content/io.js | 15 +++++++++++---- common/content/options.js | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/common/content/io.js b/common/content/io.js index 6ad268bc..e63b3849 100644 --- a/common/content/io.js +++ b/common/content/io.js @@ -118,9 +118,16 @@ function IO() //{{{ function joinPaths(head, tail) { let path = ioManager.getFile(head); - path.appendRelativePath(ioManager.expandPath(tail)); // FIXME: should only expand env vars and normalise path separators - if (path.exists()) - path.normalize(); + try + { + path.appendRelativePath(ioManager.expandPath(tail)); // FIXME: should only expand env vars and normalise path separators + if (path.exists()) + path.normalize(); + } + catch(e) + { + return { exists: function () false }; + } return path; } @@ -943,7 +950,7 @@ lookup: liberator.echomsg("finished sourcing " + filename.quote(), 2); - liberator.log("Sourced: " + file.path, 3); + liberator.log("Sourced: " + filename, 3); } catch (e) { diff --git a/common/content/options.js b/common/content/options.js index 2dfb7e63..353bf5bf 100644 --- a/common/content/options.js +++ b/common/content/options.js @@ -683,7 +683,7 @@ function Options() //{{{ context.completions = [ [loadPreference(filter, null, false), "Current Value"], [loadPreference(filter, null, true), "Default Value"] - ]; + ].filter(function ([k]) k != null); return; }