1
0
Fork 0

fix(diagnostics): handle null case

curl-error
Felix Becker 2017-12-03 15:49:43 -08:00
parent 9b1fafae58
commit 09477b747e
1 changed files with 1 additions and 1 deletions

View File

@ -99,7 +99,7 @@ class TreeAnalyzer
// Find the first ancestor that's a class method. Return an error
// if there is none, or if the method is static.
$method = $node->getFirstAncestor(Node\MethodDeclaration::class);
if ($method->isStatic()) {
if ($method && $method->isStatic()) {
$this->diagnostics[] = new Diagnostic(
"\$this can not be used in static methods.",
Range::fromNode($node),