1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-08-06 22:04:19 +00:00

Fix crash when transcluding an undefined variable

Thanks @pmario

See https://github.com/Jermolene/TiddlyWiki5/pull/6666#issuecomment-1114692359
This commit is contained in:
jeremy@jermolene.com 2022-05-02 11:15:18 +01:00
parent fbd0357cae
commit a10106a4a6

View File

@ -172,6 +172,7 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
var parser;
if(this.transcludeVariable) {
var variableInfo = this.getVariableInfo(this.transcludeVariable).srcVariable;
if(variableInfo) {
parser = this.wiki.parseText(this.transcludeType,variableInfo.value || "",{parseAsInline: !this.parseTreeNode.isBlock});
if(parser && variableInfo.isFunctionDefinition) {
parser = {
@ -190,6 +191,7 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
parser.tree[0].orderedAttributes.push(attr);
});
}
}
} else {
parser = this.wiki.parseTextReference(
this.transcludeTitle,