We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c4abc43 commit 89de166Copy full SHA for 89de166
1 file changed
system/Entity.php
@@ -295,12 +295,12 @@ public function __get(string $key)
295
$result = $this->castAs($result, $this->_options['casts'][$key]);
296
}
297
298
- if(isset($result) && $result !== null)
+ if(! isset($result) && ! property_exists($this, $key))
299
{
300
- return $result;
+ throw EntityException::forTryingToAccessNonExistentProperty($key, __CLASS__);
301
302
303
- throw EntityException::forTryingToAccessNonExistentProperty($key, __CLASS__);
+ return $result;
304
305
306
0 commit comments