From e23a0edb70755441cd65a5af2bac8d20cb1d16f0 Mon Sep 17 00:00:00 2001 From: Richard Worth Date: Sun, 8 Jun 2008 00:55:44 +0000 Subject: [PATCH] core widget - fail gracefully if unknown method name supplied --- ui/ui.core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/ui.core.js b/ui/ui.core.js index 7b96ced5a..d033a8cc0 100644 --- a/ui/ui.core.js +++ b/ui/ui.core.js @@ -101,7 +101,7 @@ $.widget = function(name, prototype) { return this.each(function() { var instance = $.data(this, name); - if (isMethodCall && instance) { + if (isMethodCall && instance && $.isFunction(instance[options])) { instance[options].apply(instance, args); } else if (!isMethodCall) { $.data(this, name, new $[namespace][name](this, options)); -- 2.39.5