From e6b0e954b5b91f18cdeb57eab78cabaf0adb7315 Mon Sep 17 00:00:00 2001 From: Andreas Fried Date: Wed, 30 Sep 2015 00:48:15 +0200 Subject: [PATCH] Fix off-by-one: The chatHead is in fact a valid message index. This fixes #2751. --- src/node/db/API.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/db/API.js b/src/node/db/API.js index 3f34a8e4..87b6d747 100644 --- a/src/node/db/API.js +++ b/src/node/db/API.js @@ -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)