diff --git a/CRM/Core/CodeGen/Specification.php b/CRM/Core/CodeGen/Specification.php index b4f2c26f48a1..719db4ee5243 100644 --- a/CRM/Core/CodeGen/Specification.php +++ b/CRM/Core/CodeGen/Specification.php @@ -706,7 +706,7 @@ public function getDynamicForeignKey(&$foreignXML, &$dynamicForeignKeys) { $foreignKey = [ 'idColumn' => trim($foreignXML->idColumn), 'typeColumn' => trim($foreignXML->typeColumn), - 'key' => trim($this->value('key', $foreignXML)), + 'key' => trim($this->value('key', $foreignXML) ?? ''), ]; $dynamicForeignKeys[] = $foreignKey; }