If that happens, that's why we have VP and a predetermined order of succession.
Sure, there's an order of succession in the system. But you never want to actually have to use it. It's like fire sprinklers: they're a great thing that stops a bigger problem, but using them incurs a ton of collateral damage as well. In this case having a president die induces a lot of political uncertainty both domestic and abroad, it causes productivity to drop as everyone stops to watch CNN and/or the funeral, and the markets drop as well. It's not a good outcome for anyone (except maybe the VP).
As you get old, you develop medical conditions. Both Trump and Clinton are older than the average main party candidate. Presidents aren't immune to aging- and *gasp* could die in office.
Which is why even before all of this political nonsense I've been mulling over whether both candidates are too old for the job. The presidency is notoriously stressful, and since the age of TV we've seen just how physically hard it is on the presidents. Poor Obama looks like he's aged 15-20 years in the span of 8. Now we want to put people who are old enough that they'll be in their late 70s if they serve a full 8 year term?
With age comes wisdom, which is essential to this job. But I can't help but feel the major parties erred on this one. Both candidates have the age (the wisdom is debatable), but we've gone far enough down one end of the spectrum that I fear we've ended up with candidates that won't live to see the end of their potential presidencies. Which invokes all of the problems above.