1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00

Add null check

This commit is contained in:
Matthew Brown 2018-11-06 09:18:39 -05:00
parent 8354b6e055
commit 6cf6d2cfda

View File

@ -108,6 +108,10 @@ class ParseTree
}
do {
if ($current_leaf->parent === null) {
break;
}
$current_leaf = $current_leaf->parent;
} while (!$current_leaf instanceof ParseTree\EncapsulationTree
&& !$current_leaf instanceof ParseTree\CallableTree