Merge pull request #13707 from woocommerce/fix-13699
Abort gallery script when there are no images
This commit is contained in:
commit
40a86c28eb
|
@ -77,6 +77,11 @@ jQuery( function( $ ) {
|
||||||
this.$target = $target;
|
this.$target = $target;
|
||||||
this.$images = $( '.woocommerce-product-gallery__image', $target );
|
this.$images = $( '.woocommerce-product-gallery__image', $target );
|
||||||
|
|
||||||
|
// No images? Abort.
|
||||||
|
if ( 0 === this.$images.length ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Make this object available.
|
// Make this object available.
|
||||||
$target.data( 'product_gallery', this );
|
$target.data( 'product_gallery', this );
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue