Unit testing?
Bottom line though is that this is the sort of goof that should have been picked up by testing.
...picked up by unit testing/test cases written by the Developer who wrote it.
And if that code was originally written by a couple of Pair-Programmers, then, both should be taken out and shot.