[TextEditor] Fixed possible crash.