Skip to content

Commit

Permalink
feat: check if slidesEl is defined in loopDestroy (#7906)
Browse files Browse the repository at this point in the history
* feat: check if slidesEl is defined

* style: fix prettier
  • Loading branch information
eduardobattisti authored Mar 4, 2025
1 parent ffb3a09 commit ced30cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/loop/loopDestroy.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default function loopDestroy() {
const swiper = this;
const { params, slidesEl } = swiper;
if (!params.loop || (swiper.virtual && swiper.params.virtual.enabled)) return;
if (!params.loop || !slidesEl || (swiper.virtual && swiper.params.virtual.enabled)) return;
swiper.recalcSlides();

const newSlidesOrder = [];
Expand Down

0 comments on commit ced30cb

Please sign in to comment.