From 555afff015ec2fa785726bf0d9169d25d53ba679 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Julius=20H=C3=A4rtl?= <jus@bitgrid.net>
Date: Wed, 23 Jan 2019 16:35:35 +0100
Subject: [PATCH] Make sure we query the node before fetching the name
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Julius Härtl <jus@bitgrid.net>
---
 core/Controller/CollaborationResourcesController.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/core/Controller/CollaborationResourcesController.php b/core/Controller/CollaborationResourcesController.php
index ea21f0c584a..a5a40145fb7 100644
--- a/core/Controller/CollaborationResourcesController.php
+++ b/core/Controller/CollaborationResourcesController.php
@@ -198,6 +198,10 @@ class CollaborationResourcesController extends OCSController {
 	}
 
 	protected function prepareResources(IResource $resource): array {
+		if (!$resource->canAccess($this->userSession->getUser())) {
+			return [];
+		}
+
 		return [
 			'type' => $resource->getType(),
 			'id' => $resource->getId(),
-- 
GitLab