better editor test

@fangel:

> So the test needs to either be !== undefined (instead of
"undefined"), or have the typeof. Otherwise there is a risk of calling
a method on undefined.