Browse Source

fix bug when no admin be user exists

Olivier Massot 4 years ago
parent
commit
b37a53da7b
1 changed files with 5 additions and 3 deletions
  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) {