瀏覽代碼

try catch

Guillermo Espinoza 7 年之前
父節點
當前提交
5d423246bf
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      Twig/IsGrantedPreviousAdminExtension.php

+ 5 - 1
Twig/IsGrantedPreviousAdminExtension.php

@@ -44,7 +44,11 @@ class IsGrantedPreviousAdminExtension extends \Twig_Extension
      */
     public function isGrantedPreviousAdmin()
     {
-        return $this->webservice->makeGetRequest($this->urlBase . '/admin/user/is_granted');
+        try {
+            return $this->webservice->makeGetRequest($this->urlBase . '/admin/user/is_granted');
+        } catch (\Exception $e) {
+            return false;
+        }
     }
 
     /**