Download

"Invalid" FString?

I am having a problem with crashes due to the engine sending me an FString that according to the debugger is Invalid. I’m not entirely sure what that means in this context. I am not talking about a null pointer, besides an FString isn’t a pointer value anyway. The value as shown in the VC debugger is Invalid, but not a string “Invalid”, just Invalid.

I’m trying to understand what this is, and also how to detect and handle it? I don’t see any FString method for determining if it is valid or not, and if I try to do anything with it such as checking if it is empty or not, then UE crashes.

So basically I have a crash that I can’t seem to protect myself from :frowning:

hi john, you can share your code in order to help you

There isn’t really any code. It is literally one line of code :stuck_out_tongue: I have subscribed to a delegate in the engine itself and that will sometimes send my function an Invalid string. I am just hoping to fidn a way to safely handle that. You can see this AnswerHub post about the underlying problem, but really this post was just to try and find a way to actually handle being given in Invalid string until such time as the underlying bug can be fixed.

https://answers.unrealengine.com/questions/350392/onassetpathchanged-returns-invalid-fstring.html

As for my code, like I said the delegate function is literally one line of code, I am just taking the value passed to the delegate function and saving it in a member property. The problem is that occasionally under certain conditions as detailed in the AnswerHub post, the passed value is not valid.