Skip to content

Commit 50f813c

Browse files
author
riatiger
committed
fix for Uncaught TypeError
Prevents "Uncaught TypeError: Object #<Object> has no method 'abort'" error for case when non-jQuery promise is used as a handler (AngularJS $promise for example).
1 parent 0967c67 commit 50f813c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

select2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ the specific language governing permissions and limitations under the Apache Lic
431431
data = data ? data.call(self, query.term, query.page, query.context) : null;
432432
url = (typeof url === 'function') ? url.call(self, query.term, query.page, query.context) : url;
433433

434-
if (handler) { handler.abort(); }
434+
if (handler && typeof handler.abort === "function") { handler.abort(); }
435435

436436
if (options.params) {
437437
if ($.isFunction(options.params)) {

0 commit comments

Comments
 (0)