Skip to content

Commit

Permalink
Fixed handler unsubscription error on multiple create/destroy events …
Browse files Browse the repository at this point in the history
…in a row
  • Loading branch information
Gleb Mikheev committed Aug 22, 2018
1 parent a9bdb79 commit 51ee5f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/class.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SwiperClass {
events.split(' ').forEach((event) => {
if (typeof handler === 'undefined') {
self.eventsListeners[event] = [];
} else {
} else if (self.eventsListeners[event] && self.eventsListeners[event].length) {
self.eventsListeners[event].forEach((eventHandler, index) => {
if (eventHandler === handler) {
self.eventsListeners[event].splice(index, 1);
Expand Down

0 comments on commit 51ee5f8

Please sign in to comment.