0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Added check for missing DB data

- this check should never really be hit unless the DB has missing data,
  but the code tries to read from an undefined variable and crashes, which we
  can protect against
- this can be triggered by doing a `knex-migrator init` followed by a
  `knex-migrator rollback --v 3.0 --force`
This commit is contained in:
Daniel Lockyer 2020-11-05 12:13:58 +00:00
parent a3c8b032de
commit d8fdf2052c

View file

@ -118,6 +118,12 @@ module.exports = {
.transacting('settings')
.where('key', key)
.select('group');
if (groupResult.length === 0) {
logging.warn(`Could not find group not found for ${key}`);
return;
}
const groupValue = groupResult[0].group;
return await options
.transacting('settings')