1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-23 06:11:25 +01:00

Avoid cloning undefined array index

This commit is contained in:
Oliver Hader 2022-07-20 21:36:49 +02:00
parent ac315fb0a3
commit 6c5e5f77fa
No known key found for this signature in database
GPG Key ID: C19FAFD699012A5A

View File

@ -124,7 +124,7 @@ class Reconciler
$cloned_referenceds = [];
foreach ($existing_references as $reference => $referenced) {
if (!isset($cloned_referenceds[$referenced])) {
if (!isset($cloned_referenceds[$referenced]) && isset($old_existing_types[$referenced])) {
$existing_types[$referenced] = clone $old_existing_types[$referenced];
$cloned_referenceds[$referenced] = true;
}