Merge pull request #19971 from woocommerce/fix/19964

Fix: WC API should not try to create a product image if an empty image is passed
This commit is contained in:
Claudiu Lodromanean 2018-05-07 10:48:10 -07:00 committed by GitHub
commit ccededa35c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -290,7 +290,7 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
// Thumbnail. // Thumbnail.
if ( isset( $request['image'] ) ) { if ( isset( $request['image'] ) ) {
if ( is_array( $request['image'] ) ) { if ( is_array( $request['image'] ) && ! empty( $request['image'] ) ) {
$image = $request['image']; $image = $request['image'];
if ( is_array( $image ) ) { if ( is_array( $image ) ) {
$image['position'] = 0; $image['position'] = 0;