Skip to content

Commit e205f73

Browse files
authored
Merge pull request linuxfrorg#346 from linuxfrorg/1991_remove_control_chars_vs_nil
Fix #1991 Souci indéfini sur le tsv de la tribune
2 parents e2f3d6a + f1385d0 commit e205f73

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/models/board.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,10 @@ def clean
101101

102102
def remove_control_chars(msg)
103103
sanitized = ""
104-
msg.each_char do |char|
105-
sanitized << char unless char.ascii_only? and (char.ord < 32 or char.ord == 127)
104+
unless msg.nil?
105+
msg.each_char do |char|
106+
sanitized << char unless char.ascii_only? and (char.ord < 32 or char.ord == 127)
107+
end
106108
end
107109
return sanitized
108110
end

0 commit comments

Comments
 (0)