Skip to content

Commit

Permalink
fix: critical error when null product (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
creative-andrew authored Jan 21, 2025
1 parent 3a2ad1d commit bd67c97
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: netzstrategen, fabianmarz, juanlopez4691, lucapipolo, tha_sun, gyo
Tags: gallery, image gallery, video gallery, carousel, lightbox, slider, responsive gallery, image slider, lightgallery, flickity
Requires at least: 5.0
Tested up to: 6.2
Stable tag: 3.2.3
Stable tag: 3.2.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -24,6 +24,9 @@ Gallerya transforms the WordPress native post gallery into a full fledged slides

== Changelog ==

= 3.2.4 =
Fixed error when missing product

= 3.2.3 =
Fixed missing fallback in case array key is not defined.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gallerya",
"version": "3.2.3",
"version": "3.2.4",
"title": "gallerya",
"description": "gallerya is a WordPress plugin that allows you to create galleries.",
"author": "netzstrategen <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
Plugin Name: Gallerya
Version: 3.2.3
Version: 3.2.4
Text Domain: gallerya
Description: Change the native post gallery to be displayed as a slider with lightbox support.
Author: netzstrategen
Expand Down
2 changes: 1 addition & 1 deletion src/WooCommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ public static function woocommerce_template_loop_product_thumbnail() {
global $product, $wpdb;
$attachment_ids = [];

if ($product->is_type('variable')) {
if ($product && $product->is_type('variable')) {
// Add the main product image.
$attachment_ids[] = $product->get_image_id();
// Add the first image of each product variation.
Expand Down

0 comments on commit bd67c97

Please sign in to comment.