Skip to content

Commit

Permalink
When no file, dont try to read
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterbrandsen authored Feb 28, 2025
1 parent 318d405 commit 526a8ad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/adapters/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down

0 comments on commit 526a8ad

Please sign in to comment.