Skip to content

Commit 4d24016

Browse files
Update NodeScopeResolver.php to prevent null expected
1 parent 5be1d2c commit 4d24016

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4966,7 +4966,12 @@ private function processArgs(
49664966
$scope = $scope->pushInFunctionCall($calleeReflection, $parameter);
49674967
}
49684968

4969-
$originalArg = $arg?->getAttribute(ArgumentsNormalizer::ORIGINAL_ARG_ATTRIBUTE) ?? $arg;
4969+
// Attempt to prevent null exception at line 4974 when calling getAttritbute
4970+
if(!isset($arg) && !is_object($arg)) {
4971+
continue;
4972+
}
4973+
4974+
$originalArg = $arg->getAttribute(ArgumentsNormalizer::ORIGINAL_ARG_ATTRIBUTE) ?? $arg;
49704975
$nodeCallback($originalArg, $scope);
49714976

49724977
$originalScope = $scope;

0 commit comments

Comments
 (0)