mirror of
https://github.com/status-im/go-waku.git
synced 2025-01-14 15:54:20 +00:00
fix: set default response if nil
This commit is contained in:
parent
8911f48e82
commit
8d885febf7
@ -404,6 +404,12 @@ func (store *WakuStore) queryFrom(ctx context.Context, q *pb.HistoryQuery, selec
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if historyResponseRPC.Response == nil {
|
||||
historyResponseRPC.Response = new(pb.HistoryResponse)
|
||||
historyResponseRPC.Response.PagingInfo = new(pb.PagingInfo)
|
||||
historyResponseRPC.Response.PagingInfo.Cursor = new(pb.Index)
|
||||
}
|
||||
|
||||
metrics.RecordMessage(ctx, "retrieved", len(historyResponseRPC.Response.Messages))
|
||||
|
||||
return historyResponseRPC.Response, nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user