Skip to content

Commit 07aa061

Browse files
committed
Ensure target is a function before calling
1 parent 92e0741 commit 07aa061

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

js/bootstrap-datepicker.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,9 @@
635635
if (!data) {
636636
$this.data('datepicker', (data = new Datepicker(this, $.extend({}, $.fn.datepicker.defaults,options))));
637637
}
638-
if (typeof option == 'string') data[option].apply(data, args);
638+
if (typeof option == 'string' && typeof data[option] == 'function') {
639+
data[option].apply(data, args);
640+
}
639641
});
640642
};
641643

0 commit comments

Comments
 (0)