From 942d4995c52e8755100a72052d9f0d0f3bb62a17 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 1060161..e1f526a 100644 --- a/src/Error/Error.php +++ b/src/Error/Error.php @@ -271,7 +271,7 @@ class Error extends \Exception implements \JsonSerializable, ClientAware $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); } },