Skip to content
Snippets Groups Projects
Commit e37ad667 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

prevent warning and error when deleting consultation slots, fixes #932

Closes #932
parent b27d77c6
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@ class ConsultationSlot extends SimpleORMap
};
$config['registered_callbacks']['after_delete'][] = function ($slot) {
$block = $slot->block;
if (count($block->slots) === 0) {
if ($block && count($block->slots) === 0) {
$block->delete();
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment