throw exception if relation is missing related_model
[tine20] / tine20 / Tinebase / Relations.php
index 9767552..403760f 100644 (file)
@@ -394,6 +394,10 @@ class Tinebase_Relations
         }
         
         foreach ($_relations as $relation) {
+            if (! is_string($relation->related_model)) {
+                throw new Tinebase_Exception_InvalidArgument('missing relation model');
+            }
+
             if (empty($relation->related_record) || $relation->related_record instanceof $relation->related_model) {
                 continue;
             }