don't throw exception on empty template container id
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 28 Apr 2014 08:42:05 +0000 (10:42 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 28 Apr 2014 10:09:18 +0000 (12:09 +0200)
Change-Id: Ib50e1ac4b6f967f6c35102fcdbfb805efc1b5ce0
Reviewed-on: http://gerrit.tine20.com/customers/564
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/Frontend/Json/Abstract.php

index 39ed021..0a8ac13 100644 (file)
@@ -515,7 +515,10 @@ abstract class Tinebase_Frontend_Json_Abstract extends Tinebase_Frontend_Abstrac
     public function getTemplates($containerId = NULL)
     {
         if (! $containerId) {
-            throw new Tinebase_Exception_InvalidArgument('A container id must be set!');
+            return array(
+                'totalcount' => 0,
+                'results'    => array(),
+            );
         }
     
         try {