diff --git a/lib/PermissionManager.php b/lib/PermissionManager.php index b8673a25ea..fd77a42d8e 100644 --- a/lib/PermissionManager.php +++ b/lib/PermissionManager.php @@ -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; } }