diff --git a/tcpdf.php b/tcpdf.php index 2cbbc4d7..f894d221 100644 --- a/tcpdf.php +++ b/tcpdf.php @@ -7884,7 +7884,7 @@ public function Output($name='doc.pdf', $dest='I') { * @since 4.5.016 (2009-02-24) */ public function _destroy($destroyall=false, $preserve_objcopy=false) { - if (isset(self::$cleaned_ids[$this->file_id])) { + if (isset($this->file_id) && isset(self::$cleaned_ids[$this->file_id])) { $destroyall = false; } if ($destroyall AND !$preserve_objcopy && isset($this->file_id)) {