Fixed NRE after leaving editor.
Merge pull request #1 from ozraven/master

Fixed NRE after leaving editor.