From: Bjoern Schiessle Date: Mon, 30 Sep 2013 11:05:34 +0000 (+0200) Subject: also return success if no shares are found. X-Git-Tag: v6.0.0alpha2~95^2~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=513dc20d4b851381a9096807a930fd7b371a553b;p=nextcloud-server.git also return success if no shares are found. --- diff --git a/apps/files_sharing/lib/api.php b/apps/files_sharing/lib/api.php index 455784558b5..c3048da9a41 100644 --- a/apps/files_sharing/lib/api.php +++ b/apps/files_sharing/lib/api.php @@ -44,11 +44,12 @@ class Api { $share = \OCP\Share::getItemShared('file', null); - if ($share !== null) { - return new \OC_OCS_Result($share); + if ($share === false) { + return new \OC_OCS_Result(null, 404, 'could not get shares'); } else { - return new \OC_OCS_Result(null, 404, 'no shares available'); + return new \OC_OCS_Result($share); } + } /**