Skip to content

Commit

Permalink
handle nil
Browse files Browse the repository at this point in the history
  • Loading branch information
MSalopek committed May 2, 2024
1 parent cae1e35 commit 44ec847
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion x/ccv/provider/ibc_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,13 @@ func (im IBCMiddleware) OnRecvPacket(
) exported.Acknowledgement {
// executes the IBC transfer OnRecv logic
ack := im.app.OnRecvPacket(ctx, packet, relayer)
ctx.Logger().Info("OnRecvPacket", "ack", ack)

// Note that inside the below if condition statement,
// we know that the IBC transfer succeeded. That entails
// that the packet data is valid and can be safely
// deserialized without checking errors.
if ack.Success() {
if ack == nil || ack.Success() {
// execute the middleware logic only if the sender is a consumer chain
consumerID, err := im.keeper.IdentifyConsumerChainIDFromIBCPacket(ctx, packet)
if err != nil {
Expand Down

0 comments on commit 44ec847

Please sign in to comment.