]> source.dussan.org Git - nextcloud-server.git/commitdiff
Improve performance of UserMountCache with external storage folders 7120/head
authorDariusz Olszewski <starypatyk@users.noreply.github.com>
Fri, 27 Oct 2017 21:22:35 +0000 (23:22 +0200)
committerMorris Jobke <hey@morrisjobke.de>
Thu, 9 Nov 2017 09:07:27 +0000 (10:07 +0100)
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
lib/private/Files/Config/UserMountCache.php

index 6ec78e4d81c1b77dbcdda0db454f020b830a78b1..5829fdf512c66f7b1ff1c7994a1bc427f44b2d22 100644 (file)
@@ -193,7 +193,11 @@ class UserMountCache implements IUserMountCache {
                if (is_null($user)) {
                        return null;
                }
-               return new CachedMountInfo($user, (int)$row['storage_id'], (int)$row['root_id'], $row['mount_point'], $row['mount_id'], isset($row['path'])? $row['path']:'');
+               $mount_id = $row['mount_id'];
+               if (!is_null($mount_id)) {
+                       $mount_id = (int) $mount_id;
+               }
+               return new CachedMountInfo($user, (int)$row['storage_id'], (int)$row['root_id'], $row['mount_point'], $mount_id, isset($row['path'])? $row['path']:'');
        }
 
        /**