Skip to content

Commit a07975d

Browse files
committed
Added isset check for the attachment type.
1 parent 6694ca0 commit a07975d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

includes/Classifai/Features/ImageCropping.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ public function generate_smart_crops( array $metadata, int $attachment_id ): arr
170170
* @param array $response Array of prepared attachment data.
171171
* @return array
172172
*/
173-
public function set_media_library_attachment_size( array $response ): array {
174-
if ( 'image' !== $response['type'] ) {
173+
public function set_media_library_attachment_size( $response ) {
174+
if ( ! isset( $response['type'] ) || 'image' !== $response['type'] ) {
175175
return $response;
176176
}
177177

0 commit comments

Comments
 (0)