diff --git a/safe-svg.php b/safe-svg.php index 2b6b1bc3..3dd2dbdf 100644 --- a/safe-svg.php +++ b/safe-svg.php @@ -698,7 +698,7 @@ protected function svg_dimensions( $attachment_id ) { * @param int $attachment_id The image attachment ID. */ public function disable_srcset( $image_meta, $size_array, $image_src, $attachment_id ) { - if ( $attachment_id && 'image/svg+xml' === get_post_mime_type( $attachment_id ) ) { + if ( $attachment_id && 'image/svg+xml' === get_post_mime_type( $attachment_id ) && is_array( $image_meta ) ) { $image_meta['sizes'] = array(); }