Fix off-by-one: The chatHead is in fact a valid message index.

This fixes #2751.
This commit is contained in:
Andreas Fried 2015-09-30 00:48:15 +02:00
parent 77496b357c
commit e6b0e954b5
1 changed files with 2 additions and 2 deletions

View File

@ -473,9 +473,9 @@ exports.getChatHistory = function(padID, start, end, callback)
end = pad.chatHead;
}
if(start >= chatHead && chatHead > 0)
if(start > chatHead)
{
callback(new customError("start is higher or equal to the current chatHead","apierror"));
callback(new customError("start is higher than the current chatHead","apierror"));
return;
}
if(end > chatHead)