Skip to content

Commit 16ed988

Browse files
committed
Re #1 - Make sure the instance has the user specified method before trying to invoke it
1 parent 152cd02 commit 16ed988

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/jqfactory.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@
8585
existingInstance._init.apply(existingInstance, arguments);
8686
if($.type(firstArg) === 'string') {
8787
args.shift();
88-
existingInstance[firstArg].apply(existingInstance, args);
88+
if($.isFunction(existingInstance[firstArg])) {
89+
existingInstance[firstArg].apply(existingInstance, args);
90+
}
8991
}
9092
return;
9193
}

src/jqfactory.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)