Skip to content

Commit

Permalink
fixed error on deleting empty relations
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-graute committed Mar 24, 2021
1 parent 4f6d031 commit a4cc420
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Pressmind/ORM/Object/MediaType/AbstractMediaType.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ protected function _deleteHasManyRelation($property_name)
$relations = $this->$property_name;
if(is_array($relations)) {
foreach ($relations as $relation) {
$relation->delete(true);
if (!empty($relation)) {
$relation->delete(true);
}
}
}
}
Expand Down

0 comments on commit a4cc420

Please sign in to comment.