diff --git a/backend/migrations/20211108145214_regenerate_default_host.js b/backend/migrations/20211108145214_regenerate_default_host.js index 41feee5..4c50941 100644 --- a/backend/migrations/20211108145214_regenerate_default_host.js +++ b/backend/migrations/20211108145214_regenerate_default_host.js @@ -5,6 +5,10 @@ const internalNginx = require('../internal/nginx'); async function regenerateDefaultHost(knex) { const row = await knex('setting').select('*').where('id', 'default-site').first(); + if (!row) { + return Promise.resolve(); + } + return internalNginx.deleteConfig('default') .then(() => { return internalNginx.generateConfig('default', row);