From 253e9bcc0414c51be9d5d69bd2dad883499e79c2 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Fri, 31 Jan 2025 09:09:13 +0100 Subject: [PATCH] Create new size if get_size() returns null --- includes/class-simple-local-avatars.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-simple-local-avatars.php b/includes/class-simple-local-avatars.php index 14dacc2..6bb785d 100644 --- a/includes/class-simple-local-avatars.php +++ b/includes/class-simple-local-avatars.php @@ -438,7 +438,7 @@ public function get_simple_local_avatar_url( $id_or_email, $size ) { $editor = wp_get_image_editor( $avatar_full_path ); if ( ! is_wp_error( $editor ) ) { $image_size = $editor->get_size(); - if ( $image_size['width'] !== $size || $image_size['height'] !== $size ) { + if ( ! $image_size || $image_size['width'] !== $size || $image_size['height'] !== $size ) { $resized = $editor->resize( $size, $size, true ); if ( ! is_wp_error( $resized ) ) { $dest_file = $editor->generate_filename();