mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
handle not found mounts when cleaning avatars
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
10aa287463
commit
05d2f61a59
2 changed files with 9 additions and 0 deletions
|
|
@ -1362,6 +1362,9 @@ class View {
|
|||
$path = Filesystem::normalizePath($this->fakeRoot . '/' . $path);
|
||||
|
||||
$mount = Filesystem::getMountManager()->find($path);
|
||||
if (!$mount) {
|
||||
return false;
|
||||
}
|
||||
$storage = $mount->getStorage();
|
||||
$internalPath = $mount->getInternalPath($path);
|
||||
if ($storage) {
|
||||
|
|
@ -1411,6 +1414,9 @@ class View {
|
|||
$path = $this->getAbsolutePath($directory);
|
||||
$path = Filesystem::normalizePath($path);
|
||||
$mount = $this->getMount($directory);
|
||||
if (!$mount) {
|
||||
return [];
|
||||
}
|
||||
$storage = $mount->getStorage();
|
||||
$internalPath = $mount->getInternalPath($path);
|
||||
if ($storage) {
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ use OCP\Defaults;
|
|||
use OCA\Theming\Util;
|
||||
use OCP\Federation\ICloudIdManager;
|
||||
use OCP\Authentication\LoginCredentials\IStore;
|
||||
use OCP\Files\NotFoundException;
|
||||
use OCP\ICacheFactory;
|
||||
use OCP\IDBConnection;
|
||||
use OCP\IL10N;
|
||||
|
|
@ -1151,6 +1152,8 @@ class Server extends ServerContainer implements IServerContainer {
|
|||
try {
|
||||
$avatar = $manager->getAvatar($user->getUID());
|
||||
$avatar->remove();
|
||||
} catch (NotFoundException $e) {
|
||||
// no avatar to remove
|
||||
} catch (\Exception $e) {
|
||||
// Ignore exceptions
|
||||
$logger->info('Could not cleanup avatar of ' . $user->getUID());
|
||||
|
|
|
|||
Loading…
Reference in a new issue