mirror of https://github.com/status-im/go-waku.git
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…
Reference in New Issue