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>
  • Loading branch information
solracsf authored Dec 13, 2023
1 parent 96521d0 commit f250482
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/Versions/VersionsBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,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 75 in lib/Versions/VersionsBackend.php

View workflow job for this annotation

GitHub Actions / Nextcloud

UndefinedClass

lib/Versions/VersionsBackend.php:75:13: UndefinedClass: Class, interface or enum named OCA\GroupFolders\Versions\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 +131,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 136 in lib/Versions/VersionsBackend.php

View workflow job for this annotation

GitHub Actions / Nextcloud

UndefinedClass

lib/Versions/VersionsBackend.php:136:12: UndefinedClass: Class, interface or enum named OCA\GroupFolders\Versions\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 f250482

Please sign in to comment.