From 07ca05017dfa41459df9fc7cf0d0267330bf62a2 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Thu, 1 May 2014 15:59:06 +0100 Subject: [PATCH] team.widget returns undefined is there are no widgets of the specified type. --- src/mkws-team.js | 3 +++ 1 file changed, 3 insertions(+) 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"); } -- 1.7.10.4