Add throw if the there is an attempt to remove the bot

This commit is contained in:
Holly Stubbs 2022-02-23 03:23:11 +00:00
parent 5f5b8457de
commit 1219bbca38
Signed by: tgpholly
GPG key ID: B8583C4B7D18119E

View file

@ -20,6 +20,11 @@ global.addUser = function(uuid, userToAdd) {
} }
global.removeUser = function(userToRemove) { global.removeUser = function(userToRemove) {
// This should be safe to do since we should be in a try-catch at all times
// I just want a trace of how this is happening.
if (userToRemove.uuid == "bot")
throw "Tried to remove the bot user!";
delete userToRemove; delete userToRemove;
global.refreshUserKeys(); global.refreshUserKeys();
} }