PadMessageHandler.js: fixed logic error in a guard condition

The guard condition on count being non negative and < 100 used the wrong
boolean operator. In its form it was impossible.

This error was introduced in 2013, in 5592c4b0fe.
Fixes #3499
pull/3572/head
muxator 2019-02-27 00:56:41 +01:00
parent 4b913172fe
commit 90bfbeb38d
1 changed files with 2 additions and 2 deletions

View File

@ -462,9 +462,9 @@ function handleGetChatMessages(client, message)
var start = message.data.start; var start = message.data.start;
var end = message.data.end; var end = message.data.end;
var count = start - count; var count = end - start;
if(count < 0 && count > 100) if(count < 0 || count > 100)
{ {
messageLogger.warn("Dropped message, GetChatMessages Message, client requested invalid amout of messages!"); messageLogger.warn("Dropped message, GetChatMessages Message, client requested invalid amout of messages!");
return; return;