From 4ae3eaf3d248742e16c656a546df60b092a2d46e Mon Sep 17 00:00:00 2001 From: Thomas Broust Date: Wed, 2 May 2018 19:22:32 +0200 Subject: [PATCH] Fixes rom copy bug if file does not exist --- package.json | 2 +- src/roms.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 4959de5..c8b22a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "arcade-manager", - "version": "4.1.0", + "version": "4.2.0", "description": "Arcade games manager to be used with Retropie and Recalbox", "main": "src/index.js", "scripts": { diff --git a/src/roms.js b/src/roms.js index 0479aad..6a74b34 100644 --- a/src/roms.js +++ b/src/roms.js @@ -22,6 +22,10 @@ module.exports = class Roms extends events { * @returns The entry size with the size unit */ entrySize(entry) { + if (!fs.existsSync(entry)) { + return ''; + } + let size = 0; let stat = fs.statSync(entry);