Commit 2d8848ca authored by masala's avatar masala

never return a nil document without an error

this shouldn't happen but somehow does.
see also:
parent 8167ec9f
......@@ -443,7 +443,10 @@ func (s *state) documentForEpoch(epoch uint64) ([]byte, error) {
// If we have a serialized document, return it.
if d, ok := s.documents[epoch]; ok {
return d.raw, nil
if d.raw != nil {
return d.raw, nil
return nil, fmt.Errorf("nil document for epoch %d", epoch)
// Otherwise, return an error based on the time.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment