Skip to content

Commit

Permalink
fix: Do not fail if node has no owner
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr authored and backportbot-nextcloud[bot] committed Nov 9, 2023
1 parent fe33917 commit 66752f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/PermissionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function shouldWatermark(Node $node, ?string $userId = null, ?IShare $sha
}

if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_shareAll', 'no') === 'yes') {
if ($node->getOwner()->getUID() !== $userId) {
if ($userId === null || $node->getOwner()?->getUID() !== $userId) {
return true;
}
}
Expand Down

0 comments on commit 66752f9

Please sign in to comment.