mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 12:55:26 +01:00
Add null check
This commit is contained in:
parent
509aadc08a
commit
2b2d1c1060
@ -373,12 +373,14 @@ class ArrayMapReturnTypeProvider implements \Psalm\Plugin\EventHandler\FunctionR
|
||||
|
||||
$callable_type = $statements_source->node_data->getType($function_call_arg->value);
|
||||
|
||||
foreach ($callable_type->getAtomicTypes() as $atomic_type) {
|
||||
if ($atomic_type instanceof Type\Atomic\TKeyedArray
|
||||
&& \count($atomic_type->properties) === 2
|
||||
&& isset($atomic_type->properties[0])
|
||||
) {
|
||||
$lhs_instance_type = clone $atomic_type->properties[0];
|
||||
if ($callable_type) {
|
||||
foreach ($callable_type->getAtomicTypes() as $atomic_type) {
|
||||
if ($atomic_type instanceof Type\Atomic\TKeyedArray
|
||||
&& \count($atomic_type->properties) === 2
|
||||
&& isset($atomic_type->properties[0])
|
||||
) {
|
||||
$lhs_instance_type = clone $atomic_type->properties[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user