Fixed errors related to managing emotes.
This commit is contained in:
@ -26,10 +26,7 @@ namespace HermesSocketServer.Socket.Handlers
|
||||
if (message is not EmoteDetailsMessage data || sender.Id == null)
|
||||
return;
|
||||
|
||||
if (data.Emotes == null)
|
||||
return;
|
||||
|
||||
if (!data.Emotes.Any())
|
||||
if (data.Emotes == null || !data.Emotes.Any())
|
||||
return;
|
||||
|
||||
lock (_lock)
|
||||
@ -38,7 +35,7 @@ namespace HermesSocketServer.Socket.Handlers
|
||||
{
|
||||
if (_emotes.Contains(entry.Key))
|
||||
{
|
||||
_emotes.Remove(entry.Key);
|
||||
data.Emotes.Remove(entry.Key);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -46,6 +43,9 @@ namespace HermesSocketServer.Socket.Handlers
|
||||
}
|
||||
}
|
||||
|
||||
if (!data.Emotes.Any())
|
||||
return;
|
||||
|
||||
int rows = 0;
|
||||
string sql = "INSERT INTO \"Emote\" (id, name) VALUES (@idd, @name)";
|
||||
using (var connection = await _database.DataSource.OpenConnectionAsync())
|
||||
|
Reference in New Issue
Block a user