I see a few unique crashes under this ID. Could you please provide the callstack of the crash you are seeing that is related to this post so that I can identify which one we should be focused on?
will cause the crash. However the use of map.Add( TEXT(“me”), info ) will work. This suggests to me that the operator of the TMap for lvalues has not been implemented correctly (hence the assertion failure in the crash log).
however the lvalue variant only should maybe read (pseudocode)
auto * Pair = Pairs.Find(Key);
if (Pair == nullptr)
{
Pair = create_pair( Key, Value );
Pairs.Add( Pair );
}
return Pair->Value;
This ensures that map[x] = y doesn’t assert if there is no x in the map. Assertions should not really be taking down the entire editor, really - loss of project data is a serious downer.
Hi Sean, no that kinda got lost in the mix as I had a whole bunch of crash reports. Please refer to the reply I made 4 days ago, the bug is in the lvalue variant of the operator of the TMap class. I should be able to say
map["x"] = 10;
even if there is no existing “x” entry. However the operator calls FindItem() which returns nullptr if the entry is not present, and then asserts. Note that
auto y = map["x"]
can justifiably assert, so the code is goo for the rvalue version of the operator.
It looks like you’re using regular array notation. What you need to do is use map.Add instead. This issue is probably related to UHT or UBT looking for formatting, and since you’ve discovered that using map.Add works properly, then continue to use that in the future to avoid running into this issue.