Skip to content

Crash when opening animation blueprint #8

@iznaut

Description

@iznaut

When opening an animation blueprint with this plugin enabled, UE4 will crash.

UE4Editor_ElgEditorScripting!UElgEditorContext_LevelEditor::HandleEditorModeEnter() [E:\P4NoGoblin\NG3Game\Plugins\ElgEditorScripting\Source\ElgEditorScripting\Private\EditorContexts\ElgEditorContext_LevelEditor.cpp:203]

The third line of this function in ElgEditorContext_LevelEditor.cpp was the problem:

void UElgEditorContext_LevelEditor::HandleEditorModeEnter(const FEditorModeID& ModeID)
{	
	FText oldName = CurrentEditorMode;
	FEdMode* mode = GLevelEditorModeTools().GetActiveMode(ModeID);
	CurrentEditorMode = mode->GetModeInfo().Name;
	OnEnterMode.Broadcast(CurrentEditorMode);
	if (!oldName.EqualTo(CurrentEditorMode)) {
		OnEditorModeChanged.Broadcast(CurrentEditorMode);
	}
}

My colleague was able to fix it by simply doing a check to make sure mode != NULL, so there's a workaround, but I thought I would report here so it could be properly fixed in the source.

top of the callstack was FName triggering an access violation, the crash is on the line where we're assigning a FName from a function that can return null, so I did a quick null check on the function before doing anything else

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions