Skip to content

Commit adb40f4

Browse files
authored
fix(autoplay): fix a crash with resize when the autoplay has gone away during timeout (#6431)
1 parent a61638a commit adb40f4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/core/events/onResize.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ export default function onResize() {
4444
if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {
4545
clearTimeout(timeout);
4646
timeout = setTimeout(() => {
47-
swiper.autoplay.resume();
47+
if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {
48+
swiper.autoplay.resume();
49+
}
4850
}, 500);
4951
}
5052
// Return locks after resize

0 commit comments

Comments
 (0)