Catch missing sync folder in getAllConfigFromFiles service

pull/5/head
Boaz Poolman 2021-03-27 20:21:30 +01:00
parent 567e29f3c9
commit e62f440b65
1 changed files with 4 additions and 0 deletions

View File

@ -83,6 +83,10 @@ module.exports = {
* @returns {object} Object with key value pairs of configs. * @returns {object} Object with key value pairs of configs.
*/ */
getAllConfigFromFiles: async (configType = null) => { 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 configFiles = fs.readdirSync(strapi.plugins['config-sync'].config.destination);
const getConfigs = async () => { const getConfigs = async () => {