...so, the solution for the emperor to avoid dying without an heir and dooming the world/country to an unspecified terrible fate is....to deliberately die? Becoming
undead has a rather crucial intermediary step of being
dead.
At which point the bloodline thingamajiggie could very well kick in and doom everyone anyways, even if there was less than six seconds of 'no living emperor'.
(making the Mists a more likely outcome than you might expect, since being transported to Ravenloft would definitely qualify for fulfillment of a doom prophecy.)