fix: nil paging info

This commit is contained in:
Richard Ramos 2022-12-20 12:37:16 -04:00
parent 2c6d5cd7bd
commit 77ace0d772
No known key found for this signature in database
GPG Key ID: BD36D48BC9FFC88C

View File

@ -342,10 +342,16 @@ func (store *WakuStore) Next(ctx context.Context, r *Result) (*Result, error) {
return nil, errors.New("invalid cursor")
}
return &Result{
result := &Result{
Messages: response.Messages,
cursor: response.PagingInfo.Cursor,
query: q,
peerId: r.PeerID(),
}, nil
}
if response.PagingInfo != nil {
result.cursor = response.PagingInfo.Cursor
}
return result, nil
}