aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Search/Result/File.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Search/Result/File.php b/lib/private/Search/Result/File.php
index c3b0c4e3751..f8779f8ccbd 100644
--- a/lib/private/Search/Result/File.php
+++ b/lib/private/Search/Result/File.php
@@ -133,7 +133,11 @@ class File extends \OCP\Search\Result {
$userID = $userSession->getUser()->getUID();
self::$userFolderCache = \OC::$server->getUserFolder($userID);
}
- return self::$userFolderCache->getRelativePath($path);
+ $relativePath = self::$userFolderCache->getRelativePath($path);
+ if ($relativePath === null) {
+ throw new \Exception("Search result not in user folder");
+ }
+ return $relativePath;
}
/**