This removes a conditional that checks if pindex is equal to nullptr.
This check is redundant because the branch where pindex is set returns at an earlier time. Additionaly, The independence of the earlier and later pindex is made clearer.
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/20868 | core#20868]]