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:
parent
a3c8b032de
commit
d8fdf2052c
1 changed files with 6 additions and 0 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Reference in a new issue