From 60e262dece2402cc7a144e560cb8fef56a93affe Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 13 Aug 2018 18:30:47 +0200 Subject: [PATCH] Fix bug in Spectre import. --- app/Services/Spectre/Object/Account.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Services/Spectre/Object/Account.php b/app/Services/Spectre/Object/Account.php index d3cfceb689..e8069f99f1 100644 --- a/app/Services/Spectre/Object/Account.php +++ b/app/Services/Spectre/Object/Account.php @@ -67,8 +67,8 @@ class Account extends SpectreObject $this->nature = $data['nature']; $this->createdAt = new Carbon($data['created_at']); $this->updatedAt = new Carbon($data['updated_at']); - - foreach ($data['extra'] as $key => $value) { + $extraArray = \is_array($data['extra']) ? $data['extra'] : []; + foreach ($extraArray as $key => $value) { $this->extra[$key] = $value; } }