check that the export::getResult return an array

if the export does not return an array, and UnexpectedValueException is thrown
This commit is contained in:
Julien Fastré 2016-05-25 10:56:37 +02:00
parent 63a1ab8d93
commit baba8dbe5f

View File

@ -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();