The code for creating the candidate block map assumes that the passed block's previous block (pindex->pprev) is available and otherwise segfaults due to null-pointer deference in CBlockIndexWorkComparator(). Rather than analyzing all possible code paths and implications for this corner case, simply fail early if the genesis block is passed.
This is a backport of core#20921