Reading from binary array of file causes error

Hey, guys! I have stuck up in a problem.
I wanted to store some data in the file during the game is being played. Later when the game is reopened the data from file needs to be extracted for other required tasks.
So for storing and retrieving data, I followed this link.

Prior I was storing a TMap inside the file. But later as per the requirement I also had to store FString along with TMap. It works perfectly normal until I tested it with the old file(which contains only TMap). So while loading it crashes since the file does not contain the FSting.

Is there any way to check prior reading binary array that it has data of FString or not?
Or how to make a crash free scenario?

If the file is binary serialization, then probably there is no way to checkā€¦ From what I saw in your link, it does not add any metadata, so either you read it correctly or crash.
That is why it is important/useful, when serializing to custom binary formats, always start with an int32 version number. That way you can check in the file itself whether you should read a FString or not.
Otherwise, you will have to know if the file you open is old or new format, then read the FString or not depending on that.