Avoid crash of paste null string to UI's textedit