From e62f440b6591132d47bd12dd8cb5fa067ee8c302 Mon Sep 17 00:00:00 2001 From: Boaz Poolman Date: Sat, 27 Mar 2021 20:21:30 +0100 Subject: [PATCH] Catch missing sync folder in getAllConfigFromFiles service --- services/main.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/main.js b/services/main.js index 9adc07a..9537d13 100644 --- a/services/main.js +++ b/services/main.js @@ -83,6 +83,10 @@ module.exports = { * @returns {object} Object with key value pairs of configs. */ getAllConfigFromFiles: async (configType = null) => { + if (!fs.existsSync(strapi.plugins['config-sync'].config.destination)) { + return {}; + } + const configFiles = fs.readdirSync(strapi.plugins['config-sync'].config.destination); const getConfigs = async () => {