Hi following code is throwing an exception. Normally Find will return the nullptr if you are searching for a key that is not in the Map… But it is throwing an exception. Could anyone help me with this.
USTRUCT(BlueprintType)
struct SomeAPI GameRemap
{
GENERATED_BODY()
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
TMap<Type*, Type*> Entries;
};
UPROPERTY(EditDefaultsOnly)
TMap<TSubclassOf<GameKey>, GameRemap> Remapping;
Type* Func( Type X)
{
GameRemap* CurrentMap= Remapping.Find(GameKey);
Type* target = *(CurrentMap->Entries).Find(X); //exception is thrown here
}