throw exception if relation is missing related_model
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 28 Sep 2015 14:49:38 +0000 (16:49 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Tue, 29 Sep 2015 12:35:43 +0000 (14:35 +0200)
Change-Id: I3586d714e3965285736a705ac8ce7a7ea426833e
Reviewed-on: http://gerrit.tine20.com/customers/2227
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
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;
             }