UE4 crush when opened project with GetWidget

If I add the GetAllWidgetOfClass function to the PlayerController, then this project stops opening. The function works and does not cause any problems for the editor. But after the project is closed, it is impossible to open it. Help me please. Here is the error log on GoogleDrive