From: Mike Taylor Date: Thu, 1 May 2014 14:59:06 +0000 (+0100) Subject: team.widget returns undefined is there are no widgets of the specified type. X-Git-Tag: 1.0.0~759 X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=07ca05017dfa41459df9fc7cf0d0267330bf62a2 team.widget returns undefined is there are no widgets of the specified type. --- diff --git a/src/mkws-team.js b/src/mkws-team.js index ef216fc..4d65628 100644 --- a/src/mkws-team.js +++ b/src/mkws-team.js @@ -452,6 +452,9 @@ function team($, teamName) { that.widget = function(type) { var list = m_widgets[type]; + + if (!list) + return undefined; if (list.length > 1) { alert("widget('" + type + "') finds " + list.length + " widgets: using first"); }