pindex can not be nullptr, so document that.
This concludes backport of core#27570
https://github.com/bitcoin/bitcoin/pull/27570/commits/fa3f74a40efa0db3af31438e9250c41bc7406749
(partial) https://github.com/bitcoin/bitcoin/pull/27570/commits/fa5d7c39eb992467e43b12db213b27913374fb83
Depends on D16015