1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 03:57:21 +00:00

fix for broken plugin tiddlers that do not contain a tiddlers field;

avoids runtime errors upstream when accessing subtiddlers inside a
(broken) tiddler and when using the plugintiddlers filter operator.
This commit is contained in:
TheDiveO 2014-09-26 22:33:47 +02:00
parent eacb9e53eb
commit b1fb0a2a07
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ exports.plugintiddlers = function(source,operator,options) {
var results = [];
source(function(tiddler,title) {
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) {
results.push(title);
});

View File

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