1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 12:07:19 +00:00

Fix problem with getTiddlerLinks()

It was crashing if it encountered a link widget that didn't have a `to`
attribute.
This commit is contained in:
Jeremy Ruston 2013-10-27 13:54:39 +00:00
parent 124a7bed95
commit b1208a8d37

View File

@ -335,7 +335,7 @@ exports.getTiddlerLinks = function(title) {
checkParseTree = function(parseTree) {
for(var t=0; t<parseTree.length; t++) {
var parseTreeNode = parseTree[t];
if(parseTreeNode.type === "element" && parseTreeNode.tag === "$link" && parseTreeNode.attributes.to.type === "string") {
if(parseTreeNode.type === "element" && parseTreeNode.tag === "$link" && parseTreeNode.attributes.to && parseTreeNode.attributes.to.type === "string") {
var value = parseTreeNode.attributes.to.value;
if(links.indexOf(value) === -1) {
links.push(value);