diff --git a/includes/class-wc-install.php b/includes/class-wc-install.php index 93ab40b0278..d81b86b185a 100644 --- a/includes/class-wc-install.php +++ b/includes/class-wc-install.php @@ -1332,7 +1332,12 @@ CREATE TABLE {$wpdb->prefix}wc_reserved_stock ( 'post_content' => '', 'post_status' => 'inherit', ); - $attach_id = wp_insert_attachment( $attachment, $filename ); + + $attach_id = wp_insert_attachment( $attachment, $filename ); + if ( is_wp_error( $attach_id ) ) { + update_option( 'woocommerce_placeholder_image', 0 ); + return; + } update_option( 'woocommerce_placeholder_image', $attach_id );