From 526a8ad9e3ce1bbcb5d7b69e92659c6d8ffe8afe Mon Sep 17 00:00:00 2001 From: Pieter Date: Fri, 28 Feb 2025 23:05:52 +0100 Subject: [PATCH] When no file, dont try to read --- lib/adapters/file.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/adapters/file.js b/lib/adapters/file.js index bd1ab6d..19eb242 100644 --- a/lib/adapters/file.js +++ b/lib/adapters/file.js @@ -20,6 +20,9 @@ class FileAdapter { } read (room, tick, callback) { const file = this.getFilePath(room, tick) + if (!fs.existsSync(file)) { + return Promise.resolve().asCallback(callback) + } return Promise.resolve() .then(data => fs.readFileAsync(file)) .then(data => zlib.gunzipAsync(data, 'utf8'))