Make sure src is not null

This commit is contained in:
Mike Jolley 2016-12-15 13:04:50 +00:00
parent ad4704f02d
commit c92d9d4a49
2 changed files with 2 additions and 2 deletions

View File

@ -528,7 +528,7 @@
$product_img_wrap = $product.find( '.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:eq(0)' ), $product_img_wrap = $product.find( '.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:eq(0)' ),
$product_img = $product.find( '.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:eq(0) .wp-post-image' ); $product_img = $product.find( '.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:eq(0) .wp-post-image' );
if ( variation && variation.image && variation.image.src.length > 1 ) { if ( variation && variation.image && variation.image.src && variation.image.src.length > 1 ) {
$product_img.wc_set_variation_attr( 'src', variation.image.src ); $product_img.wc_set_variation_attr( 'src', variation.image.src );
$product_img.wc_set_variation_attr( 'height', variation.image.src_h ); $product_img.wc_set_variation_attr( 'height', variation.image.src_h );
$product_img.wc_set_variation_attr( 'width', variation.image.src_w ); $product_img.wc_set_variation_attr( 'width', variation.image.src_w );

File diff suppressed because one or more lines are too long