1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-18 07:44:51 +00:00

Merge pull request #914 from TheDiveO/master

Avoid runtime errors in presence of broken plugin tiddlers
This commit is contained in:
Jeremy Ruston 2014-09-27 10:15:32 +01:00
commit 9dff0c4b12
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ exports.plugintiddlers = function(source,operator,options) {
var results = []; var results = [];
source(function(tiddler,title) { source(function(tiddler,title) {
var pluginInfo = options.wiki.getPluginInfo(title) || options.wiki.getTiddlerData(title,{tiddlers:[]}); var pluginInfo = options.wiki.getPluginInfo(title) || options.wiki.getTiddlerData(title,{tiddlers:[]});
if(pluginInfo) { if(pluginInfo && pluginInfo.tiddlers) {
$tw.utils.each(pluginInfo.tiddlers,function(fields,title) { $tw.utils.each(pluginInfo.tiddlers,function(fields,title) {
results.push(title); results.push(title);
}); });

View File

@ -570,7 +570,7 @@ exports.sortByList = function(array,listTitle) {
exports.getSubTiddler = function(title,subTiddlerTitle) { exports.getSubTiddler = function(title,subTiddlerTitle) {
var bundleInfo = this.getPluginInfo(title) || this.getTiddlerData(title); var bundleInfo = this.getPluginInfo(title) || this.getTiddlerData(title);
if(bundleInfo) { if(bundleInfo && bundleInfo.tiddlers) {
var subTiddler = bundleInfo.tiddlers[subTiddlerTitle]; var subTiddler = bundleInfo.tiddlers[subTiddlerTitle];
if(subTiddler) { if(subTiddler) {
return new $tw.Tiddler(subTiddler); return new $tw.Tiddler(subTiddler);