diff --git a/src/Madnest/Madzipper/Madzipper.php b/src/Madnest/Madzipper/Madzipper.php index cc7a7c6..705d375 100644 --- a/src/Madnest/Madzipper/Madzipper.php +++ b/src/Madnest/Madzipper/Madzipper.php @@ -64,7 +64,7 @@ public function __construct(Filesystem $fs = null) */ public function __destruct() { - if (is_object($this->repository)) { + if (is_object($this->repository) && $this->repository->isOpen()) { $this->repository->close(); } } @@ -511,8 +511,6 @@ private function getCurrentFolderWithTrailingSlash() return $this->currentFolder; } - //---------------------PRIVATE FUNCTIONS------------- - /** * @param $pathToZip *