Skip to content

Commit

Permalink
PHP 8 fix, issue haruncpi#6
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrik Krehák committed Apr 2, 2021
1 parent 99820d9 commit 539166d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Classes/SimpleImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct($image = null) {
// Destroys the image resource
//
public function __destruct() {
if($this->image !== null && get_resource_type($this->image) === 'gd') {
if($this->image !== null && gettype($this->image) == 'object' && get_class($this->image) == 'GdImage') {
imagedestroy($this->image);
}
}
Expand Down Expand Up @@ -1797,4 +1797,4 @@ public static function normalizeColor($color) {
throw new \Exception("Invalid color value: $color", self::ERR_INVALID_COLOR);
}

}
}

0 comments on commit 539166d

Please sign in to comment.