A frame can out live it's page, for example when a frame is detached (so pageDestroyed() is called). We could still have a reference to the window from javascript. The patch is simple to check !frame and !frame->page()
<rdar://problem/6008014>
This shouldn't be hard to fix.
Created attachment 25010 [details] Proposed patch
Comment on attachment 25010 [details] Proposed patch I prefer to do page && page->chrome()->canRunModal() instead of a separate if statement. r=me
Landed in r38248.