From d9cb7d2053dedf883e2f37c51e7fa7bb941038f8 Mon Sep 17 00:00:00 2001 From: Florian Sommariva Date: Tue, 7 Nov 2023 16:38:43 +0100 Subject: [PATCH] Avoid app crashes if `/customization/html/details` folder is missing --- frontend/src/services/getConfig.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/src/services/getConfig.js b/frontend/src/services/getConfig.js index 9d3887bae..9d2a3091e 100644 --- a/frontend/src/services/getConfig.js +++ b/frontend/src/services/getConfig.js @@ -3,6 +3,9 @@ const deepmerge = require('deepmerge'); const { getLocales } = require('./getLocales'); function getFiles(dir, files = []) { + if (!fs.existsSync(dir)) { + return files; + } const fileList = fs.readdirSync(dir); for (const file of fileList) { const name = `${dir}/${file}`;