Skip to content

Commit

Permalink
Exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
daftspunk committed Jan 30, 2024
1 parent d00c6a9 commit 0f640e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Database/Models/DeferredBinding.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ protected function deleteSlaveRecord()

// Only delete it if the relationship is null
$foreignKey = array_get($options, 'key', $masterObject->getForeignKey());
if (!$relatedObj->$foreignKey) {
if ($foreignKey && !$relatedObj->$foreignKey) {
$relatedObj->delete();
}
}
Expand Down

0 comments on commit 0f640e6

Please sign in to comment.