Fix bug when editor is not defined