# TMap Throwing exception for Find Operation

**URL:** <https://forums.unrealengine.com/t/tmap-throwing-exception-for-find-operation/477828>\
**Category:** C++\
**Tags:** tmap, unreal-engine, UE4, CPP, question\
**Created:** [January 26, 2021, 10:11pm UTC](https://forums.unrealengine.com/t/tmap-throwing-exception-for-find-operation/477828 "2021-01-26T22:11:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GME\_ding](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GME\_ding](https://forums.unrealengine.com/u/GME_ding)\
**Post date:** [January 26, 2021, 10:11pm UTC](https://forums.unrealengine.com/t/tmap-throwing-exception-for-find-operation/477828/1 "2021-01-26T22:11:30Z")

</div>

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
}
```
