Fix crash when receiving invalid UTF-8 characters

This commit is contained in:
Eric B. Budd 2021-09-07 22:17:57 -05:00
parent 7c3fad429e
commit b3d3640f97
1 changed files with 1 additions and 0 deletions

View File

@ -841,6 +841,7 @@ class Interface
end
def replying_handler(line)
line.encode!('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
if line !~ /^\.$/
if @text_buffer.empty?
@text_buffer = line