diff --git a/CRM/ManualDirectDebit/Hook/BuildForm/CustomData.php b/CRM/ManualDirectDebit/Hook/BuildForm/CustomData.php index 9080f9a..49b5291 100644 --- a/CRM/ManualDirectDebit/Hook/BuildForm/CustomData.php +++ b/CRM/ManualDirectDebit/Hook/BuildForm/CustomData.php @@ -58,7 +58,8 @@ public function run() { private function checkIfDirectDebitMandateInGroupTree() { $customGroupTree = $this->form->getVar('_groupTree'); - return array_key_exists($this->directDebitMandateId, $customGroupTree); + + return !empty($customGroupTree) && array_key_exists($this->directDebitMandateId, $customGroupTree); } /**