diff --git a/lib/public/share.php b/lib/public/share.php
index 6c93139b10789ae8c50b27bcc25aa9152eea4af0..81f5515bb4ba1d50522d9a00a364c71aa69c3e7d 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -1009,7 +1009,7 @@ class Share {
 					if (!isset($mounts[$row['storage']])) {
 						$mountPoints = \OC\Files\Filesystem::getMountByNumericId($row['storage']);
 						if (is_array($mountPoints)) {
-							$mounts[$row['storage']] = $mountPoints[key($mountPoints)];
+							$mounts[$row['storage']] = current($mountPoints);
 						}
 					}
 					if ($mounts[$row['storage']]) {