Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected "null" in CHAT_JSON message crashes the plugin #50

Open
thebirk opened this issue Jul 20, 2022 · 1 comment
Open

Unexpected "null" in CHAT_JSON message crashes the plugin #50

thebirk opened this issue Jul 20, 2022 · 1 comment

Comments

@thebirk
Copy link

thebirk commented Jul 20, 2022

When attempting to parse a CHAT_JSON message where any of the element has a null value the plugin crashes.

[   ScriptRuntime] [16:52:19] [BetterChat]  $FFFCHAT_JSON:{"login":null,"nickname":null,"text":"You do not have access to this command"}
[   ScriptRuntime] [16:52:19] [BetterChat]  Script exception: Json value is not a string!
[   ScriptRuntime] [16:52:19] [BetterChat]    src/ChatLine.as (line 83, column 5)
[   ScriptRuntime] [16:52:19] [BetterChat]      #0  void ChatLine::ParseLine(const string&in line) (src/ChatLine.as line 83)
[   ScriptRuntime] [16:52:19] [BetterChat]      #1  ChatLine::ChatLine(uint id, int64 time, const string&in line) (src/ChatLine.as line 30)
[   ScriptRuntime] [16:52:19] [BetterChat]      #2  ChatLine@ ChatLine(uint id, int64 time, const string&in line) (src/ChatLine.as line 0)
[   ScriptRuntime] [16:52:19] [BetterChat]      #3  void ChatWindow::AddLine(const string&in line) (src/ChatWindow.as line 108)
[   ScriptRuntime] [16:52:19] [BetterChat]      #4  void ChatWindow::OnChatMessage(const string&in line) (src/ChatWindow.as line 171)
[   ScriptRuntime] [16:52:19] [BetterChat]      #5  void ChatMessageLoop() (src/ChatMessageLoop.as line 104)
@codecat
Copy link
Owner

codecat commented Jul 20, 2022

This is technically not in line with the specification defined in the readme (you should just omit the values instead of pass null).

I will fix this crash soon though, thanks for the report! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants