The orginal Enterprise had an emergency antimatter-ejection procedure for cases of magnetic containment failure, I am assuming that later ships would have a similar safeguard (I read about this in Mr. Scott's Guide to the Enterprise, which I am not sure is a canon source, but it had numerous ST technical "experts" as consulatants: Okuda, Probert, etc, so it seemed a reasonable source to me). Of course, how can ships have warp-core breaches if they can eject the antimatter? Maybe warp-core breaches only occur when a quickly-precipitated series of events preclude the implementation of safeguards. This is all starting to sound to treknobabble: I'll stop before I shoot myself in the foot.
I also believe that Federation ships have physical structural supports, in addition to the structural integrity field, so their hulls should hold up so long as they are not subjected to too extreme of stresses.
All of this would be of little use against the Imperials, though.
