diff --git a/boot/boot.js b/boot/boot.js index a9fb91b74..58c06b566 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -2080,7 +2080,11 @@ $tw.loadPluginFolder = function(filepath,excludeRegExp) { console.log("Warning: missing plugin.info file in " + filepath); return null; } - var pluginInfo = $tw.utils.parseJSONSafe(fs.readFileSync(infoPath,"utf8")); + var pluginInfo = $tw.utils.parseJSONSafe(fs.readFileSync(infoPath,"utf8"),function() {return null;}); + if(!pluginInfo) { + console.log("warning: invalid JSON in plugin.info file at " + infoPath); + pluginInfo = {}; + } // Read the plugin files var pluginFiles = $tw.loadTiddlersFromPath(filepath,excludeRegExp); // Save the plugin tiddlers into the plugin info @@ -2197,7 +2201,11 @@ $tw.loadWikiTiddlers = function(wikiPath,options) { pluginFields; // Bail if we don't have a wiki info file if(fs.existsSync(wikiInfoPath)) { - wikiInfo = $tw.utils.parseJSONSafe(fs.readFileSync(wikiInfoPath,"utf8")); + wikiInfo = $tw.utils.parseJSONSafe(fs.readFileSync(wikiInfoPath,"utf8"),function() {return null;}); + if(!wikiInfo) { + console.log("warning: invalid JSON in tiddlywiki.info file at " + wikiInfoPath); + wikiInfo = {}; + } } else { return null; }