From f9729904694eab79ded2afbb4841787622944710 Mon Sep 17 00:00:00 2001
From: Robin Appelman <robin@icewind.nl>
Date: Mon, 2 Mar 2020 14:24:45 +0100
Subject: [PATCH] dont try to update storage mtime if we can't get the mtime

Signed-off-by: Robin Appelman <robin@icewind.nl>
---
 lib/private/Files/Cache/Updater.php | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/lib/private/Files/Cache/Updater.php b/lib/private/Files/Cache/Updater.php
index 3809d4c2aeb..59cff9b3a41 100644
--- a/lib/private/Files/Cache/Updater.php
+++ b/lib/private/Files/Cache/Updater.php
@@ -224,12 +224,15 @@ class Updater implements IUpdater {
 	private function updateStorageMTimeOnly($internalPath) {
 		$fileId = $this->cache->getId($internalPath);
 		if ($fileId !== -1) {
-			$this->cache->update(
-				$fileId, [
-					'mtime' => null, // this magic tells it to not overwrite mtime
-					'storage_mtime' => $this->storage->filemtime($internalPath)
-				]
-			);
+			$mtime = $this->storage->filemtime($internalPath);
+			if ($mtime !== false) {
+				$this->cache->update(
+					$fileId, [
+						'mtime' => null, // this magic tells it to not overwrite mtime
+						'storage_mtime' => $mtime
+					]
+				);
+			}
 		}
 	}
 
-- 
GitLab