Skip to content

Commit 66127f5

Browse files
committed
Make sure parsed IRC message properties always contain strings
1 parent 806f2f1 commit 66127f5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/irclineparser.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ function parseIrcLine(line) {
2727
msg.tags = MessageTags.decode(matches[1]);
2828
}
2929

30-
msg.prefix = matches[2];
30+
msg.prefix = matches[2] || '';
3131
// Nick will be in the prefix slot if a full user mask is not used
32-
msg.nick = matches[3] || matches[2];
32+
msg.nick = matches[3] || matches[2] || '';
3333
msg.ident = matches[4] || '';
3434
msg.hostname = matches[5] || '';
35-
msg.command = matches[6];
35+
msg.command = matches[6] || '';
3636
msg.params = matches[7] ? matches[7].split(/ +/) : [];
3737

3838
// Add the trailing param to the params list

0 commit comments

Comments
 (0)