From 887c23e640784cc153c61ce21236577e5108637a Mon Sep 17 00:00:00 2001 From: kortschak Date: Wed, 24 Sep 2014 08:52:00 +0930 Subject: [PATCH] Ensure we don't examine empty token Fixes issue #163. --- graph/bolt/iterator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graph/bolt/iterator.go b/graph/bolt/iterator.go index ec298de..efb11d6 100644 --- a/graph/bolt/iterator.go +++ b/graph/bolt/iterator.go @@ -271,7 +271,7 @@ func (it *Iterator) Contains(v graph.Value) bool { return false } offset := PositionOf(val, it.dir, it.qs) - if bytes.HasPrefix(val.key[offset:], it.checkID) { + if len(val.key) != 0 && bytes.HasPrefix(val.key[offset:], it.checkID) { // You may ask, why don't we check to see if it's a valid (not deleted) quad // again? //