The patch is simple to check !frame and !frame->page()
This shouldn't be hard to fix.
Created attachment 25010 [details]
Comment on attachment 25010 [details]
I prefer to do page && page->chrome()->canRunModal() instead of a separate if statement.
Landed in r38248.