Class GameDev* SheepAdult

[Unreal Engine Crash] Click Object Crash - Assertion failed: IsSet() It is an error to call GetValue() on an unset TOptional. Please either check IsSet() or use Get.. 본문

Unreal Engine

[Unreal Engine Crash] Click Object Crash - Assertion failed: IsSet() It is an error to call GetValue() on an unset TOptional. Please either check IsSet() or use Get..

SheepAdult 2022. 12. 8. 20:15

Assertion failed: IsSet() [File:D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Public\Misc/Optional.h] [Line: 190] It is an error to call GetValue() on an unset TOptional. Please either check IsSet() or use Get(DefaultValue) instead.

 

이라는 문구가 나오면서 특정 오브젝트 클릭할 때마다 크래쉬가 났다. 넷상에 정보가 아예 없어서 혼자 끙끙댔다,, 분명 생성자가 문제일 것 같았지만 생성자는 수정한 것이 없었는데 이런 문제가 나와 당황스러웠고, 하루 동안 깃 디스카드하고 클래스 다시 만들고 하는 삽질을 한 결과 string(Text)관련 문제였다.

예를 들어 위와 같이 EditCondition의 조건을 넣어 줬었다. 그 후에 Enum class의 이름을 변경해줬지만 EditCondition 의 text는 수정을 안 해줘서 생긴 문제였다. string이라 컴파일러가 그냥 넘어가 짐작하기도 힘들었던 문제이다. 좋은 교훈을 얻은 것 같다.