From baba8dbe5fc2e54170152a20db6765620f5166b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 25 May 2016 10:56:37 +0200 Subject: [PATCH] check that the export::getResult return an array if the export does not return an array, and UnexpectedValueException is thrown --- Export/ExportManager.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Export/ExportManager.php b/Export/ExportManager.php index c3bc50672..143e739de 100644 --- a/Export/ExportManager.php +++ b/Export/ExportManager.php @@ -418,6 +418,15 @@ class ExportManager $result = $export->getResult($query, $data[ExportType::EXPORT_KEY]); + if (!is_array($result)) { + throw new \UnexpectedValueException( + sprintf( + 'The result of the export should be an array, %s given', + gettype($result) + ) + ); + } + /* @var $formatter Formatter\CSVFormatter */ $formatter = $this->getFormatter($this->getFormatterAlias($data)); $filters = array();