Fix unit test failure in EditorOptionHandlers caused by pull request #4778.

Check editor is not null before calling its hasSelection function since we're not passing editor from unit tests and EditorManager.getCurrentFullEditor() returns null for test windows.