Skip to content

Commit 1140ccc

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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Relation/BelongsTo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ private function shouldPull(Tuple $tuple, Tuple $rTuple): bool
141141
$toReference = [];
142142
foreach ($this->outerKeys as $i => $outerKey) {
143143
$innerKey = $this->innerKeys[$i];
144-
if (!\array_key_exists($innerKey, $oldData) || $oldData[$innerKey] !== $newData[$outerKey]) {
144+
if (!\array_key_exists($innerKey, $oldData) || $oldData[$innerKey] !== ($newData[$outerKey] ?? null)) {
145145
return true;
146146
}
147147
$toReference[$outerKey] = $current[$innerKey];

0 commit comments

Comments
 (0)