Unreal Engine crashes upon setting up my custom UserWidget::AddToViewport C++

I have figured out upon adding if statement. Now, when I play the game, it is executing else part only.