diff --git a/src/models/Map.php b/src/models/Map.php index 3ee5294..1f10730 100644 --- a/src/models/Map.php +++ b/src/models/Map.php @@ -64,7 +64,7 @@ public function __construct ($config = []) public function __get ($name) { - $isPart = property_exists($this->parts, $name) || $name === 'streetAddress'; + $isPart = (is_object($this->parts) && property_exists($this->parts, $name)) || $name === 'streetAddress'; if (in_array($name, PartsLegacy::$legacyKeys) && !$isPart) return null; @@ -79,7 +79,7 @@ public function canGetProperty ($name, $checkVars = true, $checkBehaviors = true try { if ( - property_exists($this->parts, $name) || + (is_object($this->parts) && property_exists($this->parts, $name)) || $name === 'streetAddress' || in_array($name, PartsLegacy::$legacyKeys) ) return true;