diff --git a/projects/plugins/jetpack/changelog/fix-carousel-null-request b/projects/plugins/jetpack/changelog/fix-carousel-null-request new file mode 100644 index 0000000000000..8696ab8d13acf --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-carousel-null-request @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Carousel: Under rare circumstances, the carousel will make null requests when loading an image diff --git a/projects/plugins/jetpack/modules/carousel/jetpack-carousel.js b/projects/plugins/jetpack/modules/carousel/jetpack-carousel.js index 797cd88029693..a84035ce95130 100644 --- a/projects/plugins/jetpack/modules/carousel/jetpack-carousel.js +++ b/projects/plugins/jetpack/modules/carousel/jetpack-carousel.js @@ -1320,7 +1320,7 @@ var max = calculateMaxSlideDimensions(); // If the startIndex is not 0 then preload the clicked image first. - if ( startIndex !== 0 ) { + if ( startIndex !== 0 && items[ startIndex ].getAttribute( 'data-gallery-src' ) !== null ) { var img = new Image(); img.src = items[ startIndex ].getAttribute( 'data-gallery-src' ); }