Jerry Weinberg pitched the concept of 'egoless programming' [0] with the suggestion that it is possible to not take reviews of your code personally, with examples from his experience. Weinberg is careful to address the problem of feeling attacked by working on the social environment to avoid or limit attacks and the consequent defenses.
Thirty years later, egoless programming is one of Robert Glass's favorite fallacies in 'Facts and Fallacies of Software Engineering.'
IOW, it is a hard problem!
The SE research community has been looking into this for awhile (e.g. Greiler, Bacchelli)
[0] 'The Psychology of Computer Programming' (1971), Gerald Weinberg
[1] 'Facts and Fallacies of Software Engineering', Robert L. Glass