浏览代码

fix bug when no admin be user exists

Olivier Massot 4 年之前
父节点
当前提交
b37a53da7b
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      ot_admin/Classes/Controller/SiteController.php

+ 5 - 3
ot_admin/Classes/Controller/SiteController.php

@@ -2341,10 +2341,12 @@ class SiteController extends ActionController
                 ->execute()
                 ->fetch();
 
-            if ((string)$rootUid != (string)$row['db_mountpoints']) {
-                throw new \RuntimeException("The be_user named '" . $expectedUsername . "' has unexpected mounted website(s)");
+            if ($row['uid']) {
+                if ((string)$rootUid != (string)$row['db_mountpoints']) {
+                    throw new \RuntimeException("The be_user named '" . $expectedUsername . "' has unexpected mounted website(s)");
+                }
+                $adminUid = $row['uid'];
             }
-            $adminUid = $row['uid'];
         }
 
         if ($adminUid == null) {