Skip to content

Commit d461288

Browse files
committed
Fix possible bug in BelongsTo
1 parent 14f8a99 commit d461288

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Relation/BelongsTo.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ private function shouldPull(Tuple $tuple, Tuple $rTuple): bool
140140
$noChanges = true;
141141
$toReference = [];
142142
foreach ($this->outerKeys as $i => $outerKey) {
143+
if (!\array_key_exists($outerKey, $newData)) {
144+
continue;
145+
}
146+
143147
$innerKey = $this->innerKeys[$i];
144148
if (!\array_key_exists($innerKey, $oldData) || $oldData[$innerKey] !== $newData[$outerKey]) {
145149
return true;

0 commit comments

Comments
 (0)