From 7d42e36c8d3010fca93f43073a884624d1f52217 Mon Sep 17 00:00:00 2001 From: dmanners Date: Fri, 27 Jan 2017 13:58:58 +0000 Subject: [PATCH] Check to see if the file handler is a resource before trying to call fclose. This was causing a warning and making the CsvTest.php fail --- .../Magento/Setup/Module/I18n/Dictionary/Writer/Csv.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setup/src/Magento/Setup/Module/I18n/Dictionary/Writer/Csv.php b/setup/src/Magento/Setup/Module/I18n/Dictionary/Writer/Csv.php index 6ca88b8d0e342..7c3518b835aa1 100644 --- a/setup/src/Magento/Setup/Module/I18n/Dictionary/Writer/Csv.php +++ b/setup/src/Magento/Setup/Module/I18n/Dictionary/Writer/Csv.php @@ -59,7 +59,9 @@ public function write(Phrase $phrase) */ public function __destructor() { - fclose($this->_fileHandler); + if (is_resource($this->_fileHandler)) { + fclose($this->_fileHandler); + } } /** @@ -67,6 +69,8 @@ public function __destructor() */ public function __destruct() { - fclose($this->_fileHandler); + if (is_resource($this->_fileHandler)) { + fclose($this->_fileHandler); + } } }