Skip to content

Commit

Permalink
fix(controller): add a conditional to early return if the swiper cont…
Browse files Browse the repository at this point in the history
…roller is destroyed (#6555)
  • Loading branch information
TakhyunKim authored Apr 11, 2023
1 parent d77f420 commit 3fbec6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/controller/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,11 @@ export default function Controller({ swiper, extendParams, on }) {
removeSpline();
});
on('setTranslate', (_s, translate, byController) => {
if (!swiper.controller.control) return;
if (!swiper.controller.control || swiper.controller.control.destroyed) return;
swiper.controller.setTranslate(translate, byController);
});
on('setTransition', (_s, duration, byController) => {
if (!swiper.controller.control) return;
if (!swiper.controller.control || swiper.controller.control.destroyed) return;
swiper.controller.setTransition(duration, byController);
});

Expand Down

0 comments on commit 3fbec6e

Please sign in to comment.