From b36caceade9e25b94681809fb3811e7726deaf65 Mon Sep 17 00:00:00 2001 From: Jayme Rotsaert Date: Wed, 1 Aug 2018 18:16:48 +0200 Subject: [PATCH] Fix: fatal Call to a member function getLocation(), before normal error is thrown --- src/Error/Error.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Error/Error.php b/src/Error/Error.php index be2c9b5..254d395 100644 --- a/src/Error/Error.php +++ b/src/Error/Error.php @@ -265,7 +265,7 @@ class Error extends \Exception implements \JsonSerializable, ClientAware }, $positions); } else if ($nodes) { $this->locations = array_filter(array_map(function ($node) { - if ($node->loc) { + if ($node->loc && $node->loc->source) { return $node->loc->source->getLocation($node->loc->start); } }, $nodes));