fix: prevent account query from returning null

This commit is contained in:
Taranto 2020-10-23 16:59:54 +01:00 committed by Josh Harvey
parent bd062c0f9f
commit 0aae7ac1ff

View file

@ -25,7 +25,7 @@ function loadAccounts () {
limit 1` limit 1`
return db.oneOrNone(sql, ['accounts', NEW_SETTINGS_LOADER_SCHEMA_VERSION]) return db.oneOrNone(sql, ['accounts', NEW_SETTINGS_LOADER_SCHEMA_VERSION])
.then(row => row ? row.data.accounts : null) .then(_.compose(_.defaultTo({}), _.get('data.accounts')))
} }
function saveConfig (config) { function saveConfig (config) {