calculate exitLocation before FrameEndTask

and add more null and dead checks to be safe