handler: Fixed issue caused by trying to post empty post. Root cause is not found, but offending posts will be ignored.
the build was successful
the build was successful
This commit is contained in:
@@ -96,6 +96,12 @@ func handler(event *irc.Event, client *irc.Client) {
|
||||
text = util.RemoveNPCAttribution(event.Text)
|
||||
}
|
||||
|
||||
// Do not dispatch empty messages.
|
||||
if len(text) < 1 || len(nick) < 1 || len(kind) < 1 {
|
||||
log.Println("Ignoring empty message from:", event.Nick)
|
||||
break
|
||||
}
|
||||
|
||||
// Dispatch it.
|
||||
bot.handlePost(channel.Name(), ChannelPost{
|
||||
Account: account,
|
||||
|
||||
@@ -28,6 +28,10 @@ func TestRemoveNPCAttribution(t *testing.T) {
|
||||
Input: "((*Correction))",
|
||||
Output: "((*Correction))",
|
||||
},
|
||||
{
|
||||
Input: "((Remove :01 goofs!*))",
|
||||
Output: "((Remove :01 goofs!*))",
|
||||
},
|
||||
}
|
||||
|
||||
for i, row := range table {
|
||||
|
||||
Reference in New Issue
Block a user