mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
Merge pull request #1447 from jhollinger/develop
Bugfixes to getChatHistory API method
This commit is contained in:
commit
a5fb1e33de
1 changed files with 4 additions and 4 deletions
|
@ -325,17 +325,17 @@ exports.getChatHistory = function(padID, start, end, callback)
|
||||||
if(!start || !end)
|
if(!start || !end)
|
||||||
{
|
{
|
||||||
start = 0;
|
start = 0;
|
||||||
end = pad.chatHead - 1;
|
end = pad.chatHead;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(start >= chatHead)
|
if(start >= chatHead && chatHead > 0)
|
||||||
{
|
{
|
||||||
callback(new customError("start is higher or equal to the current chatHead","apierror"));
|
callback(new customError("start is higher or equal to the current chatHead","apierror"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(end >= chatHead)
|
if(end > chatHead)
|
||||||
{
|
{
|
||||||
callback(new customError("end is higher or equal to the current chatHead","apierror"));
|
callback(new customError("end is higher than the current chatHead","apierror"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue