From 282f8350dd0f4ae1240d8f3b6dff8f1d04dbc41e Mon Sep 17 00:00:00 2001 From: EzzAK Date: Tue, 24 Sep 2019 22:10:36 -0700 Subject: [PATCH 1/2] Fix error for new users. --- src/ext/lib/Settings.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ext/lib/Settings.js b/src/ext/lib/Settings.js index 34e6f7a..63bc22c 100644 --- a/src/ext/lib/Settings.js +++ b/src/ext/lib/Settings.js @@ -190,7 +190,14 @@ class Settings { // if there's no settings saved, return default settings. if(! settings || (Object.keys(settings).length === 0 && settings.constructor === Object)) { - this.logger.log('info', 'settings', '[Settings::init] settings don\'t exist. Using defaults.\n#keys:', Object.keys(settings).length, '\nsettings:', settings); + this.logger.log( + 'info', + 'settings', + '[Settings::init] settings don\'t exist. Using defaults.\n#keys:', + settings != null ? Object.keys(settings).length : 0, + '\nsettings:', + settings + ); this.active = this.getDefaultSettings(); this.active.version = this.version; await this.save(); From 20161207b9a21a6695ecfc34c44e93754c25e3bc Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Wed, 25 Sep 2019 09:34:14 +0200 Subject: [PATCH 2/2] just making presence check more in line with my style, otherwise this is fine --- src/ext/lib/Settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ext/lib/Settings.js b/src/ext/lib/Settings.js index 63bc22c..ca68d9e 100644 --- a/src/ext/lib/Settings.js +++ b/src/ext/lib/Settings.js @@ -194,7 +194,7 @@ class Settings { 'info', 'settings', '[Settings::init] settings don\'t exist. Using defaults.\n#keys:', - settings != null ? Object.keys(settings).length : 0, + settings ? Object.keys(settings).length : 0, '\nsettings:', settings );