1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-26 07:13:15 +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) {
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: ""});
});
};