mirror of
https://github.com/logos-messaging/logos-messaging-go.git
synced 2026-01-07 16:33:08 +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
|
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))
|
metrics.RecordMessage(ctx, "retrieved", len(historyResponseRPC.Response.Messages))
|
||||||
|
|
||||||
return historyResponseRPC.Response, nil
|
return historyResponseRPC.Response, nil
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user