Skip to content

Commit 33515fb

Browse files
committed
Make sure the node exists so we don't error out
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
1 parent 90575bb commit 33515fb

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<description>
88
The application generates a list of shares for display at the command line
99
</description>
10-
<version>0.0.2</version>
10+
<version>0.0.3</version>
1111
<licence>agpl</licence>
1212
<author>Roeland Jago Douma</author>
1313
<namespace>ShareListing</namespace>

lib/Command/ListShares.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,13 @@ private function do(string $userId, int $filter, string $path = null): \Iterator
142142
}, $shares);
143143
}
144144

145+
$shares = iter\filter(function (IShare $share) {
146+
$userFolder = $this->rootFolder->getUserFolder($share->getShareOwner());
147+
$nodes = $userFolder->getById($share->getNodeId());
148+
149+
return $nodes !== [];
150+
}, $shares);
151+
145152
$formattedShares = iter\map(function (IShare $share) {
146153
return $this->formatShare($share);
147154
}, $shares);

0 commit comments

Comments
 (0)