lemon-sh / IRCrarria

A very simple IRC<->Terraria chat bridge for TShock.
GNU General Public License v3.0
6 stars 3 forks source link

NullReferenceException in OnLeave handler #2

Closed ncfavier closed 3 years ago

ncfavier commented 3 years ago

I get this exception from time to time:

[Server API] Warning Plugin "IRCrarria" has had an unhandled exception thrown by one of its ServerLeave handlers:
System.NullReferenceException: Object reference not set to an instance of an object
  at IRCrarria.IRCrarria.OnLeave (TerrariaApi.Server.LeaveEventArgs args) [0x00021] in <a693c28872ab49038b852c39b298eea0>:0
  at TerrariaApi.Server.HandlerCollection`1[ArgsType].Invoke (ArgsType args) [0x0004d] in <4ef9d64f26f14dbd93f29814fd475187>:0

Nothing else in the log seems to indicate a cause.

I think this would be solved by adding some checks in OnJoin and OnLeave, like it's done here.

lemon-sh commented 3 years ago

Hello again!

Thanks for the interest in my plugin! Interestingly, on my server, I found some Chinese bot IPs establishing TCP connections to the Terraria server which triggers the same bug. This would indicate that this issue happens when the Terraria handshake isn't finished successfully (automatic bots?). This bug will be fixed in the 1.2 release, once I'm done polishing the IRC framework.

Thank you so much for letting me know, have a great day <3

lemon-sh commented 3 years ago

Hello, Due to personal reasons, I was unable to develop this plugin for the past couple of weeks, but today I've released the final 1.2 version with the mentioned bug fixed, if you're still interested. Sorry for the enormous delay.

ncfavier commented 3 years ago

Thanks!