Skip to content

Commit

Permalink
[configtxlator] prevent nil pointer panic
Browse files Browse the repository at this point in the history
Signed-off-by: Artem Barger <artem@bargr.net>
  • Loading branch information
C0rWin committed Oct 11, 2024
1 parent e44a8a7 commit 0350a40
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/configtxlator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,12 @@ func computeUpdt(original, updated, output *os.File, channelID string) error {
return errors.Wrapf(err, "error computing config update")
}

cu.ChannelId = channelID

if cu == nil {
return errors.New("error marshaling computed config update: proto: Marshal called with nil")
}

cu.ChannelId = channelID

outBytes, err := proto.Marshal(cu)
if err != nil {
return errors.Wrapf(err, "error marshaling computed config update")
Expand Down

0 comments on commit 0350a40

Please sign in to comment.