Ensure we don't examine empty token

Fixes issue #163.
This commit is contained in:
kortschak 2014-09-24 08:52:00 +09:30
parent 6308affc69
commit 887c23e640

View file

@ -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?
//