Explorar o código

better error handling for currentTemplate VH

Olivier Massot %!s(int64=5) %!d(string=hai) anos
pai
achega
3794bb87d3
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      ot_templating/Classes/Page/OtPageRepository.php

+ 1 - 1
ot_templating/Classes/Page/OtPageRepository.php

@@ -94,7 +94,7 @@ class OtPageRepository extends PageRepository
     public function getCurrentTemplate() {
         $rootPageUid = $this->getCurrentSiteRootPageId();
         if (!($rootPageUid >= 0)) {
-            return '';
+            throw new \RuntimeException('Can not find any root page');
         }
 
         $rootPage = $this->getPage($rootPageUid);