Skip to content

Commit

Permalink
desc/builder: fix typo that resulted in wrong message being removed f…
Browse files Browse the repository at this point in the history
…rom its parent (#390)
  • Loading branch information
jhump authored Apr 26, 2021
1 parent 8255811 commit 2837af4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions desc/builder/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,12 +482,12 @@ func (mb *MessageBuilder) TryAddNestedMessage(nmb *MessageBuilder) error {
needToUnlinkFirst := mb.isPresentButNotChild(nmb)
if needToUnlinkFirst {
Unlink(nmb)
mb.addSymbol(nmb)
_ = mb.addSymbol(nmb)
} else {
if err := mb.addSymbol(nmb); err != nil {
return err
}
Unlink(mb)
Unlink(nmb)
}
nmb.setParent(mb)
mb.nestedMessages = append(mb.nestedMessages, nmb)
Expand Down

0 comments on commit 2837af4

Please sign in to comment.