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

Bug in v2.3.0 UE5 #311

Closed
staskjs opened this issue Apr 21, 2022 · 2 comments
Closed

Bug in v2.3.0 UE5 #311

staskjs opened this issue Apr 21, 2022 · 2 comments

Comments

@staskjs
Copy link
Contributor

staskjs commented Apr 21, 2022

Hello, I am moving to UE5, downloaded latest 2.3.0 version, I have probably found a bug trying to connect to server with Query object.

Assertion failed: Pair != nullptr [File:E:\UE5\Engine\Source\Runtime\Core\Public\Containers\Map.h] [Line: 656]

UnrealEditor_SocketIOClient!USIOMessageConvert::JsonObjectToFStringMap() [E:\Projects\sopsb\Plugins\SocketIOClient\Source\SocketIOClient\Private\SIOMessageConvert.cpp:200]

I narrowed my code down to this snippet that causes this error. It seems problem is with string values, other values don't cause crashes.

auto JsonObject = USIOJConvert::MakeJsonObject();
JsonObject->SetStringField("testString", "value");
USIOMessageConvert::JsonObjectToFStringMap(JsonObject);
@staskjs
Copy link
Contributor Author

staskjs commented Apr 21, 2022

I think I found it

SIOMessageConvert.cpp:200
Changing from ParamMap[Pair.Key] = Value->AsString(); to ParamMap.Add(Pair.Key, Value->AsString()); fixed the problem.

@getnamo
Copy link
Owner

getnamo commented Apr 21, 2022

Edit: nvm misread. Thanks for spotting this, If you want to make a pull request, I'll merge it.

Although I do suspect the error is pointing that Pair==nullptr in some instances, maybe a sanity check (Pair!=nullptr barrier) there might help

@getnamo getnamo added the bug label Apr 21, 2022
staskjs added a commit to staskjs/SocketIOClient-Unreal that referenced this issue Apr 21, 2022
getnamo added a commit that referenced this issue Apr 21, 2022
Fix bug with string fields #311
@getnamo getnamo closed this as completed Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants