diff --git a/src/DTO/Pollen.php b/src/DTO/Pollen.php index b6b739f..5494677 100644 --- a/src/DTO/Pollen.php +++ b/src/DTO/Pollen.php @@ -44,7 +44,7 @@ public function parse(array $data) : void $this->setName($data['name']); if (isset($data['forecast'])) { - $this->setForecast($data['forecast']); + $this->setForecast((string) $data['forecast']); } if (isset($data['readings']) && $data['readings']->count() > 0) { @@ -95,7 +95,7 @@ public function getName() : string */ public function setForecast(string $forecast) : self { - $this->forecast = $forecast; + $this->forecast = !empty($forecast) ? $forecast : null; return $this; }