Yep, when the sun begins to burn it's helium it will grow into a red giant then after a few billion years more it will rip itself apart condensing into a whit dwarf. I doubt humans will exist long enough to be worried about it.Unless they send Spock to deliver some red anti-matter.
But, in the end, you can file that under just another example of deus ex machina, like all of our previous contrivances.
All the best,
Nonoise