Add property test before use to avoid potential javascript error in IE9

I've observed a bug in IE9 where if a form on the page is submitted,
and contains an empty editor, this code is triggered. In my use case
node.parent was undefined, and causing the submit to ultimately fail.

This fixes the symptom, but probably not the ultimate issue.