From 53a780e31cbe903fbec7a8c5f11b5f994b88d8bf Mon Sep 17 00:00:00 2001
From: Roeland Jago Douma <roeland@famdouma.nl>
Date: Fri, 2 Feb 2018 20:08:23 +0100
Subject: [PATCH] Do not try to get the jailed path if we can't find the id

Fixes #8047

If we can't find the file by id there we should just return null instead
of trying to get the jailed path of null.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
---
 lib/private/Files/Cache/Wrapper/CacheJail.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/private/Files/Cache/Wrapper/CacheJail.php b/lib/private/Files/Cache/Wrapper/CacheJail.php
index 357851bedd5..1ad00ba44c5 100644
--- a/lib/private/Files/Cache/Wrapper/CacheJail.php
+++ b/lib/private/Files/Cache/Wrapper/CacheJail.php
@@ -312,6 +312,10 @@ class CacheJail extends CacheWrapper {
 	 */
 	public function getPathById($id) {
 		$path = $this->getCache()->getPathById($id);
+		if ($path === null) {
+			return null;
+		}
+
 		return $this->getJailedPath($path);
 	}
 
-- 
GitLab