From 87d459c5ff4e65a520419b835373f7954248697c Mon Sep 17 00:00:00 2001 From: Ruben Verhoef Date: Tue, 17 Mar 2020 19:43:03 +0100 Subject: [PATCH] Check if `Valutadatum` is found in row 8, when not found do nothing! --- app/Import/Specifics/IngDescription.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Import/Specifics/IngDescription.php b/app/Import/Specifics/IngDescription.php index 35b3f63df1..382c9bb8a4 100644 --- a/app/Import/Specifics/IngDescription.php +++ b/app/Import/Specifics/IngDescription.php @@ -135,9 +135,10 @@ class IngDescription implements SpecificInterface protected function moveValutadatumDescription(): void { $matches = array(); - preg_match('/Valutadatum: ([0-9-]+)/', $this->row[8], $matches); - $this->row[9] = date("Ymd", strtotime($matches[1])); - $this->row[8] = preg_replace('/Valutadatum: [0-9-]+/', '', $this->row[8]); + if (preg_match('/Valutadatum: ([0-9-]+)/', $this->row[8], $matches)) { + $this->row[9] = date("Ymd", strtotime($matches[1])); + $this->row[8] = preg_replace('/Valutadatum: [0-9-]+/', '', $this->row[8]); + } } /**