From e963d8a915e34ad629c1d54ede4c59d0bab8ddde Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Wed, 12 May 2021 14:23:13 +0000 Subject: [PATCH] NTR - Fix plugin download --- .../Backend/SwagUpdate/Components/Download.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Download.php b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Download.php index 8526ce8b712..cbf3c9afad9 100644 --- a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Download.php +++ b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Download.php @@ -175,13 +175,20 @@ public function downloadFile($sourceUri, $destinationUri, $totalSize, $hash) $this->verifyHash($partFile, $hash); // close local file connections before move for windows $partFilePath = $partFile->getPathname(); - fclose($destination); + + if (is_resource($destination)) { + fclose($destination); + } + unset($partFile); $this->moveFile($partFilePath, $destinationUri); } // close local file - fclose($destination); + if (is_resource($destination)) { + fclose($destination); + } + unset($partFile); return $size;