Fixed crash caused by connecting with deleted flair.

This commit is contained in:
rainbow napkin 2025-04-15 05:59:43 -04:00
parent e226d45dce
commit 46e1b2c45b
2 changed files with 11 additions and 2 deletions

View file

@ -252,7 +252,6 @@
"hooray",
"flambe",
"flambé",
"tenturnyourrainsoundsoff",
"jabroni",
"lame",
"yoke",

View file

@ -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];