no need to throw a exception we catch two lines later

Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
This commit is contained in:
Bjoern Schiessle 2016-12-22 10:59:27 +01:00
parent e9727440dd
commit 9d3de74b2d
No known key found for this signature in database
GPG Key ID: 2378A753E2BF04F6
1 changed files with 4 additions and 5 deletions

View File

@ -1055,11 +1055,10 @@ class Manager implements IManager {
public function getShareByToken($token) {
$share = null;
try {
if(!$this->shareApiAllowLinks()) {
throw new ShareNotFound();
if($this->shareApiAllowLinks()) {
$provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_LINK);
$share = $provider->getShareByToken($token);
}
$provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_LINK);
$share = $provider->getShareByToken($token);
} catch (ProviderException $e) {
} catch (ShareNotFound $e) {
}
@ -1075,7 +1074,7 @@ class Manager implements IManager {
}
}
// If it is not a link share try to fetch a federated share by token
// If it is not a link share try to fetch a mail share by token
if ($share === null && $this->shareProviderExists(\OCP\Share::SHARE_TYPE_EMAIL)) {
try {
$provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_EMAIL);