Am I the only optimist here?
As long as no-one starts chucking nukes around in large numbers before some sort of infrastructure in space is developed, humanity should be fine.
An asteroid colony (screw planets) is both self-sustaining and cheap, so you can produce them in such numbers that it'll be very difficult to destroy them all.
Hell, if you really wanted to, humans could colonise the galaxy with nothing more than artificial womb technology, decently smart AI and some sort of cheap dependable thruster.
Once a race has colonised more than a few solar systems, it's going to take supernova or Neutron Star collision level catastrophies to take them out.
A few hundred years more, and humanity will be set for millions of years to come. (unless there are aliens involved. Then humanity is srewed

)
We own all your helmets, we own all your shoes, we own all your generals. Touch us and you loooose...
The Rogue State!