Skip to content

Commit

Permalink
Merge pull request #30444 from nextcloud/backport/30353/stable22
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Dec 30, 2021
2 parents aaef453 + 8cb63f3 commit 6c051b2
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions apps/files_sharing/lib/External/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
use OCP\Files\Storage\IDisableEncryptionStorage;
use OCP\Files\StorageInvalidException;
use OCP\Files\StorageNotAvailableException;
use OCP\Http\Client\LocalServerException;

class Storage extends DAV implements ISharedStorage, IDisableEncryptionStorage {
/** @var ICloudId */
Expand Down Expand Up @@ -314,9 +315,16 @@ public function getShareInfo() {
$token = $this->getToken();
$password = $this->getPassword();

// If remote is not an ownCloud do not try to get any share info
if (!$this->remoteIsOwnCloud()) {
return ['status' => 'unsupported'];
try {
// If remote is not an ownCloud do not try to get any share info
if (!$this->remoteIsOwnCloud()) {
return ['status' => 'unsupported'];
}
} catch (LocalServerException $e) {
// throw this to be on the safe side: the share will still be visible
// in the UI in case the failure is intermittent, and the user will
// be able to decide whether to remove it if it's really gone
throw new StorageNotAvailableException();
}

$url = rtrim($remote, '/') . '/index.php/apps/files_sharing/shareinfo?t=' . $token;
Expand Down

0 comments on commit 6c051b2

Please sign in to comment.