Assume that we are past the primaries, the candidate has been set and determined, not yet to the convention, and the candidate has not yet picked a running mate, so not an incumbent either. (timeline would be April, May, June, July...)
Candidate all of a sudden dies out of the blue. Something nonviolent like a heartattack. What would you think would happen for either of the two major parties and happen at the convention? Would the deceased's staff appoint someone to take his place? Would second in the primaries take over? Would it be a free-for-all?