Fix bug when editor content becomes empty