Fix: fatal Call to a member function getLocation(), before normal error is thrown

This commit is contained in:
Jayme Rotsaert 2018-08-01 18:16:48 +02:00 committed by Martynas Sudintas
parent f1fc5d66c9
commit b36caceade

View File

@ -265,7 +265,7 @@ class Error extends \Exception implements \JsonSerializable, ClientAware
}, $positions); }, $positions);
} else if ($nodes) { } else if ($nodes) {
$this->locations = array_filter(array_map(function ($node) { $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); return $node->loc->source->getLocation($node->loc->start);
} }
}, $nodes)); }, $nodes));