scorch InternalID() handles case of unknown docId
This commit is contained in:
parent
848aca4639
commit
67986d41bf
|
@ -93,6 +93,14 @@ func TestIndexReader(t *testing.T) {
|
|||
t.Errorf("count was 2, but only saw %d", actualCount)
|
||||
}
|
||||
|
||||
internalIDBogus, err := indexReader.InternalID("a-bogus-docId")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if internalIDBogus != nil {
|
||||
t.Errorf("expected bogus docId to have nil InternalID")
|
||||
}
|
||||
|
||||
internalID2, err := indexReader.InternalID("2")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
|
|
@ -256,7 +256,7 @@ func (i *IndexSnapshot) InternalID(id string) (rv index.IndexInternalID, err err
|
|||
}()
|
||||
|
||||
next, err := tfr.Next(nil)
|
||||
if err != nil {
|
||||
if err != nil || next == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue