diff --git a/src/MetaModel/Model/MethodCall.php b/src/MetaModel/Model/MethodCall.php index 45e07b2..224d4c6 100755 --- a/src/MetaModel/Model/MethodCall.php +++ b/src/MetaModel/Model/MethodCall.php @@ -2,6 +2,7 @@ namespace MetaModel\Model; +use MetaModel\ExecutionException; use MetaModel\MetaModel; /** @@ -28,6 +29,10 @@ public function execute(MetaModel $metaModel) { $object = $this->subNode->execute($metaModel); + if (is_null($object)) { + throw new ExecutionException("Calling method '$this->method' on null"); + } + $reflectionMethod = new \ReflectionMethod($object, $this->method); // God mode