Skip to content

Commit

Permalink
fix: Fix bug when Timmy::get_image() is called with null as the attac…
Browse files Browse the repository at this point in the history
…hment parameter
  • Loading branch information
gchtr committed Sep 3, 2024
1 parent f8089b9 commit d1d102c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Timmy.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ public static function get_image( $attachment, $size ) {
$attachment = (int) $attachment['ID'];
}

if (!$attachment) {
return null;
}

// Check if we work with a WordPress post. This doesn’t necessarily have
// to be an attachment, that’s why we don’t check for the 'attachment'
// post type.
Expand Down

0 comments on commit d1d102c

Please sign in to comment.