From b6e6445e9e990fcffe2f3cedf05e0f023429585c Mon Sep 17 00:00:00 2001 From: Brett Minnie Date: Wed, 2 Jul 2014 16:55:28 +0100 Subject: [PATCH] Updated person::$warnings to test the object is created --- src/Opg/Core/Model/Entity/Person/Person.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Opg/Core/Model/Entity/Person/Person.php b/src/Opg/Core/Model/Entity/Person/Person.php index 47d4e2ed..8b17d857 100644 --- a/src/Opg/Core/Model/Entity/Person/Person.php +++ b/src/Opg/Core/Model/Entity/Person/Person.php @@ -794,12 +794,13 @@ public function getActiveWarnings() { $warningBucket = new ArrayCollection(); - foreach ($this->warnings as $warning) { - if ($warning->isActive()) { - $warningBucket->add($warning); + if (null !== $this->warnings) { + foreach ($this->warnings as $warning) { + if ($warning->isActive()) { + $warningBucket->add($warning); + } } } - return $warningBucket; } }