From 5a23c883e27feea0004fb8b256ee0074d2c84b9d Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 14 Jul 2014 14:52:00 +0100 Subject: [PATCH] More defensive checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We’ve had a few bugs with the symptom of ‘text’ being undefined. --- core/modules/widgets/widget.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/widgets/widget.js b/core/modules/widgets/widget.js index 1069c6025..e7e92449d 100755 --- a/core/modules/widgets/widget.js +++ b/core/modules/widgets/widget.js @@ -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: ""}); }); };