From 6e20ba8a621c9815254b81ad0eb6a2dfc28dc542 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 18 May 2018 21:12:44 -0400 Subject: [PATCH] Check if gameicon and boxart exist before copying. --- compatdb/app.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/compatdb/app.js b/compatdb/app.js index 5b7ecc0..9d41a2f 100644 --- a/compatdb/app.js +++ b/compatdb/app.js @@ -70,10 +70,14 @@ async function run() { x.issues = x.issues || [] // Copy the boxart for the game. - fs.copySync(`${fsPathCode}/${x.id}/boxart.png`, `${fsPathHugoBoxart}/${x.id}.png`); + if (fs.existsSync(`${fsPathCode}/${x.id}/boxart.png`)) { + fs.copySync(`${fsPathCode}/${x.id}/boxart.png`, `${fsPathHugoBoxart}/${x.id}.png`); + } // Copy the icon for the game. - fs.copySync(`${fsPathCode}/${x.id}/icon.png`, `${fsPathHugoIcon}/${x.id}.png`); + if (fs.existsSync(`${fsPathCode}/${x.id}/icon.png`)) { + fs.copySync(`${fsPathCode}/${x.id}/icon.png`, `${fsPathHugoIcon}/${x.id}.png`); + } // SAVEFILE BLOCK var fsPathCodeSavefilesGame = `${fsPathCode}/${x.id}/savefiles/`;