Skip to content

Commit 10664f4

Browse files
authored
Added a nil check for resp.GetError() in the EOS gRPC client. This fixes a nil pointer dereference in the RollbackToVersion method (#4896)
Co-authored-by: Jesse Geens <[email protected]>
1 parent d2b2c10 commit 10664f4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Bugfix: fix nilpointer error in RollbackToVersion
2+
3+
https://github.com/cs3org/reva/pull/4896

pkg/eosclient/eosgrpc/eosgrpc.go

Lines changed: 3 additions & 2 deletions
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)