Skip to content

Commit 10a81e7

Browse files
committed
Fix logical error in legacy config expression
We should check for an undefined and not just for a logical true or false. Example: When `usecdn` was set to false it was impossible to overwrite the new config value because the if statement becomes false. Thanks @davidmehren for pointing me to this issue. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
1 parent 4eef661 commit 10a81e7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/config/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ for (let i = keys.length; i--;) {
110110
// and the config with uppercase is not set
111111
// we set the new config using the old key.
112112
if (uppercase.test(keys[i]) &&
113-
config[lowercaseKey] &&
114-
!config[keys[1]]) {
113+
config[lowercaseKey] !== undefined &&
114+
fileConfig[keys[i]] === undefined) {
115115
logger.warn('config.js contains deprecated lowercase setting for ' + keys[i] + '. Please change your config.js file to replace ' + lowercaseKey + ' with ' + keys[i])
116116
config[keys[i]] = config[lowercaseKey]
117117
}

0 commit comments

Comments
 (0)