From 5ff7c7ffabe9db73b05e181c7f013669bfa934bf Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 14 Oct 2016 19:16:28 +0200 Subject: [PATCH] This should at least catch #357 --- app/Import/Importer/CsvImporter.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Import/Importer/CsvImporter.php b/app/Import/Importer/CsvImporter.php index 797335cb1d..7c572eafd1 100644 --- a/app/Import/Importer/CsvImporter.php +++ b/app/Import/Importer/CsvImporter.php @@ -113,7 +113,11 @@ class CsvImporter implements ImporterInterface $config = $this->job->configuration; // hash the row: - $hash = hash('sha256', json_encode($row)); + $json = json_encode($row); + if ($json === false) { + throw new FireflyException(sprintf('Could not process row %d. Please make sure the uploaded file is encoded as "UTF-8".', $index)); + } + $hash = hash('sha256', $json); $object->importValue('hash', 100, $hash); // and this is the point where the specifix go to work.