Looks legit, and at least per commit 13bba02271dc we do fix such things, even if it's useless in practice.
Given that no buildfarm member has ever complained, this exercise seems pretty pointless.
Hi Álvaro,
If we are passing a null pointer in these places and it should not be done,
it is a sign that perhaps these calls should not or should not be made, and they can be avoided. This would eliminate undefined behavior and save some cycles?