GetGameInstance Slate Problems

When i call GetGameInstance in SlateWidget method, editor crashing…

Part of widget code:

  • SCanvas::Slot()
    .Position(FVector2D(512.0F, 336.0F)) // 640
    .Size(FVector2D(128, 36))
    [
    SNew(SButton)
    .Text(NSLOCTEXT(“RISE”, “button_ok”, “OK”))
    .HAlign(HAlign_Center)
    .VAlign(VAlign_Center)
    .OnClicked(this, &SRLobbyCompoundWidget::LeftClickOk) /////////// LEFT CLICK OK
    ]

// Method
FReply SRLobbyCompoundWidget::LeftClickOk()
{
RGameInstance = (URGameInstance *)GEngine->GetWorld()->GetGameInstance(); /// crash this
return FReply::Handled();
}

Need help ))) How i can do that without editor’s crash, sorry for my english ))

Sorry, look this:

SCanvas::Slot()
				.Position(FVector2D(512.0F, 336.0F)) // 640
				.Size(FVector2D(128, 36))
				[
					SNew(SButton)
					.Text(NSLOCTEXT("RISE", "button_ok", "OK"))
					.HAlign(HAlign_Center)
					.VAlign(VAlign_Center)
					.OnClicked(this, &SRLobbyCompoundWidget::LeftClickOk)
				]



and 



FReply SRLobbyCompoundWidget::LeftClickOk()
{
	RGameInstance = (URGameInstance *)GEngine->GetWorld()->GetGameInstance(); // crash
	return FReply::Handled();
}

resolved, all works fine

How did you resolve it?