diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-01-06 15:56:06 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-01-06 15:56:06 +0100 |
commit | 64e3ebae74b9f47369b946fbda89a0ce6f6ffe04 (patch) | |
tree | b76f81ab5cddfa0f750cef219db3a3a835aeeec0 /apps/files/ajax | |
parent | 622c4cf77903470bc7ddc1df5b74d5e17a0e70c7 (diff) | |
download | nextcloud-server-64e3ebae74b9f47369b946fbda89a0ce6f6ffe04.tar.gz nextcloud-server-64e3ebae74b9f47369b946fbda89a0ce6f6ffe04.zip |
Add error handling to getstoragestats.php
Diffstat (limited to 'apps/files/ajax')
-rw-r--r-- | apps/files/ajax/getstoragestats.php | 6 |
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']]); +} |