Просмотр исходного кода

better error handling for currentTemplate VH

Olivier Massot 5 лет назад
Родитель
Сommit
3794bb87d3
1 измененных файлов с 1 добавлено и 1 удалено
  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() {
     public function getCurrentTemplate() {
         $rootPageUid = $this->getCurrentSiteRootPageId();
         $rootPageUid = $this->getCurrentSiteRootPageId();
         if (!($rootPageUid >= 0)) {
         if (!($rootPageUid >= 0)) {
-            return '';
+            throw new \RuntimeException('Can not find any root page');
         }
         }
 
 
         $rootPage = $this->getPage($rootPageUid);
         $rootPage = $this->getPage($rootPageUid);