From 337b2fce06eb6a39b5cf4591232f87f5c817f0bd Mon Sep 17 00:00:00 2001
From: Manish R Jain <manishrjain@gmail.com>
Date: Tue, 3 May 2016 16:04:33 +1000
Subject: [PATCH] Fix a bug due to handle negative offset

---
 posting/list.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/posting/list.go b/posting/list.go
index e858cf67..92a56e2e 100644
--- a/posting/list.go
+++ b/posting/list.go
@@ -734,6 +734,9 @@ func (l *List) GetUids(offset, count int) []uint64 {
 		count = 0 - count
 		offset = l.length() - count
 	}
+	if offset < 0 {
+		offset = 0
+	}
 
 	if count == 0 {
 		count = l.length() - offset
-- 
GitLab