Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorCraig Main <craig@palantir.co.za>2017-10-04 10:50:46 +0300
committerXhmikosR <xhmikosr@gmail.com>2017-10-04 10:51:34 +0300
commit2c2ac3356425e192f7537227508c809a14aa5850 (patch)
treec9a5041bb5563db1672fcb798c945b172b7be1cf /js
parente52df5dce5b11930dd8d8a8543f8cc3a8eab7375 (diff)
Prevent empty carousel from throwing, and staying in a 'sliding' state.
Fixes #24132.
Diffstat (limited to 'js')
-rw-r--r--js/carousel.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/js/carousel.js b/js/carousel.js
index 6ff954c9bd..2091bc351d 100644
--- a/js/carousel.js
+++ b/js/carousel.js
@@ -144,7 +144,9 @@
var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
if ($.support.transition && this.$element.hasClass('slide')) {
$next.addClass(type)
- $next[0].offsetWidth // force reflow
+ if (typeof $next === 'object' && $next.length) {
+ $next[0].offsetWidth // force reflow
+ }
$active.addClass(direction)
$next.addClass(direction)
$active