mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-10-25 20:57:38 +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:
@@ -172,6 +172,7 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
|
|||||||
var parser;
|
var parser;
|
||||||
if(this.transcludeVariable) {
|
if(this.transcludeVariable) {
|
||||||
var variableInfo = this.getVariableInfo(this.transcludeVariable).srcVariable;
|
var variableInfo = this.getVariableInfo(this.transcludeVariable).srcVariable;
|
||||||
|
if(variableInfo) {
|
||||||
parser = this.wiki.parseText(this.transcludeType,variableInfo.value || "",{parseAsInline: !this.parseTreeNode.isBlock});
|
parser = this.wiki.parseText(this.transcludeType,variableInfo.value || "",{parseAsInline: !this.parseTreeNode.isBlock});
|
||||||
if(parser && variableInfo.isFunctionDefinition) {
|
if(parser && variableInfo.isFunctionDefinition) {
|
||||||
parser = {
|
parser = {
|
||||||
@@ -190,6 +191,7 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
|
|||||||
parser.tree[0].orderedAttributes.push(attr);
|
parser.tree[0].orderedAttributes.push(attr);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
parser = this.wiki.parseTextReference(
|
parser = this.wiki.parseTextReference(
|
||||||
this.transcludeTitle,
|
this.transcludeTitle,
|
||||||
|
|||||||
Reference in New Issue
Block a user