Skip to content

Commit

Permalink
Fix NoUserException
Browse files Browse the repository at this point in the history
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

use OC\User\NoUserException

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

drop use OC\User\NoUserException

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

use OC\User\NoUserException

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
  • Loading branch information
solracsf committed Dec 13, 2023
1 parent 96521d0 commit 6865cce
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/Versions/VersionsBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

namespace OCA\GroupFolders\Versions;

use OC\User\NoUserException;
use OCA\Files_Versions\Versions\IDeletableVersionBackend;
use OCA\Files_Versions\Versions\INameableVersionBackend;
use OCA\Files_Versions\Versions\INeedSyncVersionBackend;
Expand Down Expand Up @@ -70,7 +71,11 @@ public function getVersionsForFile(IUser $user, FileInfo $file): array {
/** @var Folder $versionsFolder */
$versionsFolder = $this->getVersionsFolder($mount->getFolderId())->get((string)$file->getId());

$userFolder = $this->rootFolder->getUserFolder($user->getUID());
try {
$userFolder = $this->rootFolder->getUserFolder($user->getUID());
} catch (NoUserException $e) {

Check failure on line 76 in lib/Versions/VersionsBackend.php

View workflow job for this annotation

GitHub Actions / Nextcloud

UndefinedClass

lib/Versions/VersionsBackend.php:76:13: UndefinedClass: Class, interface or enum named OC\User\NoUserException does not exist (see https://psalm.dev/019)
return [];
}
$nodes = $userFolder->getById($file->getId());
$node = array_pop($nodes);

Expand Down Expand Up @@ -127,7 +132,12 @@ public function getVersionsForFile(IUser $user, FileInfo $file): array {
* @return IVersion[]
*/
private function getVersionsForFileFromDB(FileInfo $file, IUser $user, int $folderId): array {
$userFolder = $this->rootFolder->getUserFolder($user->getUID());
try {
$userFolder = $this->rootFolder->getUserFolder($user->getUID());
} catch (NoUserException $e) {

Check failure on line 137 in lib/Versions/VersionsBackend.php

View workflow job for this annotation

GitHub Actions / Nextcloud

UndefinedClass

lib/Versions/VersionsBackend.php:137:12: UndefinedClass: Class, interface or enum named OC\User\NoUserException does not exist (see https://psalm.dev/019)
return [];
}

/** @var Folder $versionsFolder */
$versionsFolder = $this->getVersionsFolder($folderId)->get((string)$file->getId());

Expand Down

0 comments on commit 6865cce

Please sign in to comment.