More defensive checks

We’ve had a few bugs with the symptom of ‘text’ being undefined.
print-window-tiddler
Jermolene 2014-07-14 14:52:00 +01:00
rodzic 7998686cb3
commit 5a23c883e2
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -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: ""});
});
};