Merge pull request #16682 from woocommerce/fix/16681

Remove featured image on empty image array
This commit is contained in:
Claudio Sanches 2017-09-01 17:42:38 -03:00 committed by GitHub
commit a37741b842
1 changed files with 1 additions and 1 deletions

View File

@ -1033,7 +1033,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
* @return WC_Product
*/
protected function set_product_images( $product, $images ) {
if ( is_array( $images ) ) {
if ( is_array( $images ) && ! empty( $images ) ) {
$gallery = array();
foreach ( $images as $image ) {