From 46e1b2c45b612d5505cd2a73d390e3615caeb5d6 Mon Sep 17 00:00:00 2001 From: rainbow napkin Date: Tue, 15 Apr 2025 05:59:43 -0400 Subject: [PATCH] Fixed crash caused by connecting with deleted flair. --- defaultTokes.json | 1 - src/app/channel/connectedUser.js | 12 +++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/defaultTokes.json b/defaultTokes.json index 6aa2618..7c2961e 100644 --- a/defaultTokes.json +++ b/defaultTokes.json @@ -252,7 +252,6 @@ "hooray", "flambe", "flambé", - "tenturnyourrainsoundsoff", "jabroni", "lame", "yoke", diff --git a/src/app/channel/connectedUser.js b/src/app/channel/connectedUser.js index da2f8eb..12edd34 100644 --- a/src/app/channel/connectedUser.js +++ b/src/app/channel/connectedUser.js @@ -27,7 +27,17 @@ module.exports = class{ this.user = userDB.user; this.rank = userDB.rank; this.highLevel = userDB.highLevel; - this.flair = userDB.flair.name; + + //Check to make sure users flair entry from DB is good + if(userDB.flair != null){ + //Use flair from DB + this.flair = userDB.flair.name; + //Otherwise + }else{ + //Gracefully default to classic + this.flair = 'classic'; + } + this.chanRank = chanRank; this.channel = channel; this.sockets = [socket.id];