diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index 275b8d25f1..3b615cf388 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -1239,6 +1239,7 @@ class AttributeExternalField extends AttributeDefinition { $oKeyAttDef = $this->GetKeyAttDef(); $oExtAttDef = MetaModel::GetAttributeDef($oKeyAttDef->Get("targetclass"), $this->Get("target_attcode")); + if (!is_object($oExtAttDef)) throw new CoreException("Invalid external field ".$this->GetCode()." in class ".$this->GetHostClass().". The class ".$oKeyAttDef->Get("targetclass")." has no attribute ".$this->Get("target_attcode")); return $oExtAttDef; }