Merge pull request #336 from martiis/0.12.x

from master to 0.12.x - Call to a member function getLocation() on null
This commit is contained in:
Vladimir Razuvaev 2018-09-02 21:46:02 +07:00 committed by GitHub
commit f2622fe7fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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));