Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 55dc358

Browse files
committedOct 21, 2024·
Added a nil check for resp.GetError() in the EOS gRPC client. This fixes a nil pointer dereference in the RollbackToVersion method
1 parent d2b2c10 commit 55dc358

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎pkg/eosclient/eosgrpc/eosgrpc.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -1544,8 +1544,9 @@ func (c *Client) RollbackToVersion(ctx context.Context, auth eosclient.Authoriza
15441544
return errtypes.InternalError(fmt.Sprintf("nil response for uid: '%s' ", auth.Role.UID))
15451545
}
15461546

1547-
log.Info().Str("func", "RollbackToVersion").Int64("errcode", resp.GetError().Code).Str("errmsg", resp.GetError().Msg).Msg("grpc response")
1548-
1547+
if resp.GetError() != nil {
1548+
log.Info().Str("func", "RollbackToVersion").Int64("errcode", resp.GetError().Code).Str("errmsg", resp.GetError().Msg).Msg("grpc response")
1549+
}
15491550
return err
15501551
}
15511552

0 commit comments

Comments
 (0)
Please sign in to comment.