From 65da8bd76e72dd94b882fa23e997617896f5eef2 Mon Sep 17 00:00:00 2001
From: Vincent Petry <vincent@nextcloud.com>
Date: Mon, 25 Jan 2021 12:02:14 +0100
Subject: [PATCH] Catch NotFoundException when querying quota

Fixes parent folder that becomes inaccessible when it contains a
non-existing / broken entry because the quota check made the PROPFIND
on parent fail altogether.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
---
 apps/dav/lib/Connector/Sabre/Directory.php | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/apps/dav/lib/Connector/Sabre/Directory.php b/apps/dav/lib/Connector/Sabre/Directory.php
index f2227f70151..990e57eea58 100644
--- a/apps/dav/lib/Connector/Sabre/Directory.php
+++ b/apps/dav/lib/Connector/Sabre/Directory.php
@@ -339,6 +339,8 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node implements \Sabre\DAV\ICol
 				$free
 			];
 			return $this->quotaInfo;
+		} catch (\OCP\Files\NotFoundException $e) {
+			return [0, 0];
 		} catch (\OCP\Files\StorageNotAvailableException $e) {
 			return [0, 0];
 		}
-- 
GitLab