if granularity is negative, endNum is negative and loop

This commit is contained in:
webzwo0i 2015-10-09 14:55:59 +02:00
parent 31f7c7e0f2
commit 1ee1f818db
1 changed files with 2 additions and 1 deletions

View File

@ -1365,7 +1365,8 @@ function handleChangesetRequest(client, message)
messageLogger.warn("Dropped message, changeset request has no granularity!");
return;
}
if(Number(message.data.granularity) !== message.data.granularity || message.data.granularity % 1 !== 0)
//https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger#Polyfill
if(Math.floor(message.data.granularity) !== message.data.granularity)
{
messageLogger.warn("Dropped message, changeset request granularity is not an integer!");
return;