summaryrefslogtreecommitdiffstats
path: root/apps/files/ajax/getstoragestats.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/ajax/getstoragestats.php')
-rw-r--r--apps/files/ajax/getstoragestats.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/files/ajax/getstoragestats.php b/apps/files/ajax/getstoragestats.php
index 4ab5b9a779c..fb7ccdc86cc 100644
--- a/apps/files/ajax/getstoragestats.php
+++ b/apps/files/ajax/getstoragestats.php
@@ -10,4 +10,8 @@ OCP\JSON::checkLoggedIn();
\OC::$server->getSession()->close();
// send back json
-OCP\JSON::success(array('data' => \OCA\Files\Helper::buildFileStorageStatistics($dir)));
+try {
+ OCP\JSON::success(array('data' => \OCA\Files\Helper::buildFileStorageStatistics($dir)));
+} catch (\OCP\Files\NotFoundException $e) {
+ OCP\JSON::error(['data' => ['message' => 'Folder not found']]);
+}