Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-08-28 11:51:54 +0300
committerJoas Schilling <coding@schilljs.com>2019-08-28 11:51:54 +0300
commit16c035962a3308217cc3a3f03a8e4ad99c674123 (patch)
treed831ed2e67c2992ed44e6b142a9224c943863e3a /lib
parentfd6cc4a5487124cbb165fe5bd2a77e9174e5af8c (diff)
Add a unit test and fix an issue with folders
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Files/Util.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Files/Util.php b/lib/Files/Util.php
index fc546e193..331f6d946 100644
--- a/lib/Files/Util.php
+++ b/lib/Files/Util.php
@@ -188,9 +188,12 @@ class Util {
$nodes = array_filter($nodes, function(Node $node) {
return $node->getType() === FileInfo::TYPE_FILE;
});
+ if (empty($nodes)) {
+ return null;
+ }
/** @var Node $node */
- $node = array_pop($nodes);
+ $node = array_shift($nodes);
try {
$storage = $node->getStorage();
if ($storage->instanceOfStorage(GroupFolderStorage::class)) {