1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-28 15:08:46 +00:00

More defensive checks

We’ve had a few bugs with the symptom of ‘text’ being undefined.
This commit is contained in:
Jermolene 2014-07-14 14:52:00 +01:00
parent 7998686cb3
commit 5a23c883e2

View File

@ -136,7 +136,7 @@ Widget.prototype.substituteVariableParameters = function(text,formalParams,actua
Widget.prototype.substituteVariableReferences = function(text) { Widget.prototype.substituteVariableReferences = function(text) {
var self = this; var self = this;
return text.replace(/\$\(([^\)\$]+)\)\$/g,function(match,p1,offset,string) { return (text || "").replace(/\$\(([^\)\$]+)\)\$/g,function(match,p1,offset,string) {
return self.getVariable(p1,{defaultValue: ""}); return self.getVariable(p1,{defaultValue: ""});
}); });
}; };