浏览代码

better error handling for currentTemplate VH

Olivier Massot 5 年之前
父节点
当前提交
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() {
         $rootPageUid = $this->getCurrentSiteRootPageId();
         if (!($rootPageUid >= 0)) {
-            return '';
+            throw new \RuntimeException('Can not find any root page');
         }
 
         $rootPage = $this->getPage($rootPageUid);