From 4acbae86e36b4d44091734f7ab87326cab30375e Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Tue, 13 Mar 2018 19:22:26 -0600 Subject: [PATCH] Crash on configuration when theme no longer exists #157 --- core/user_config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/user_config.js b/core/user_config.js index 70e1f068..f60d2155 100644 --- a/core/user_config.js +++ b/core/user_config.js @@ -174,9 +174,9 @@ exports.getModule = class UserConfigModule extends MenuModule { }; }), 'name'); - currentThemeIdIndex = _.findIndex(self.availThemeInfo, function cmp(ti) { + currentThemeIdIndex = Math.max(0, _.findIndex(self.availThemeInfo, function cmp(ti) { return ti.themeId === self.client.user.properties.theme_id; - }); + })); callback(null); },