#There must be a perpetual line of successors of St. Peter.
There must be a perpetual line of successors of St. Peter.
The First Vatican Council defined (Pastor Æternus ch. 2) the dogma that there will be a perpetual line of successors of St. Peter, the first pope:
If, then, any should deny…that blessed Peter should have a perpetual line of successors in the Primacy over the universal Church…: let him be anathema.
Si quis ergo dixerit, non esse … ut beatus Petrus in primatu super universam Ecclesiam habeat perpetuos successores…: anathema sit.
However, the Church put a limit on the length of an interregnum.
Nor has the Church defined that there must be a pope when the world ends, so conceivably the end of the world could occur during an interregnum. In fact, Antichrist himself will probably be a false pope (antipope).
#Interregnums can and have lasted a long time.
Interregnums can and have lasted a long time.
Showing that there have been decades-long interregnums, "How Long Can the Church Exist Without a Pope?" (February 4, 2019) by Steven Speray quotes Rev. M. P. Hill, S.J.'s 1915 The Catholic’s Ready Answer pp. 342-3:
The Great Western Schism, as it is generally named by historians, furnishes an interesting illustration of succession established with absolute certainty after a period of what was considered in some quarters as doubtful succession. The schism lasted thirty-nine years. The first of the Popes whose title was questioned was Urban VI (1378) […] There can be no doubt that a lawful successor to the See of Rome was appointed in the person of Martin V, by whose election the schism was healed. The point we insist on is that there has been a succession of legitimate pontiffs from St. Peter to Benedict XV. If during the entire schism there had been no Pope at all — that would not prove that the office and authority of Peter was not transmitted to the next Pope duly elected.
Speray shows that the Great Western (Papal) "Schism" lasted somewhere between 39-51 years, during which "it could have been that not one of them was the true Pope, and in that case, there was no Pope at all" (Francis Doyle, S.J., The Defense of the Catholic Church p. 259).