Skip to content

bluecode_apply crash when adding Blueprint class function node from UMG button event #40

Description

@winyunq

Summary

bluecode_apply can crash Unreal Editor while adding a Blueprint callable node from a UMG widget event. In this case the editor crashed inside UUmgBlueprintFunctionSubsystem::AddNode() with an access violation writing to 0x50.

Environment

  • Project: LiteRTDemo
  • Unreal Engine: 5.8
  • UMG MCP target asset: /Game/AIWerewolf/WBP_AIWerewolfGame
  • Active event graph target: StartGameButton.OnClicked
  • MCP bridge port: 127.0.0.1:55557

Reproduction

  1. Open a project using the UmgMcp plugin in UE 5.8.
  2. Set the active UMG target to /Game/AIWerewolf/WBP_AIWerewolfGame.
  3. Bind/focus a button event with bluecode_set_function("StartGameButton.OnClicked").
  4. Search a Blueprint class function node successfully: query StartNewGame or Start New Game returns Start New Game, category |Class|BP AIWerewolf Director, node class K2Node_CallFunction.
  5. Apply this bluecode with the returned action handle:
main()
  node("Start New Game")

Action handle used:

{"Start New Game":"bpact:5a885551b5f9da989c22124d1c396ef0"}

Crash

Unreal Editor crashed with:

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION writing address 0x0000000000000050

UnrealEditor_UmgMcp!UUmgBlueprintFunctionSubsystem::AddNode() [D:\UE5Project\LiteRTDemo\Source\UmgMcp\Private\Blueprint\UmgBlueprintFunctionSubsystem.cpp:3867]
UnrealEditor_UmgMcp!UUmgBlueprintFunctionSubsystem::ApplyBluecode() [D:\UE5Project\LiteRTDemo\Source\UmgMcp\Private\Blueprint\UmgBlueprintFunctionSubsystem.cpp:6017]
UnrealEditor_UmgMcp!UUmgBlueprintFunctionSubsystem::ExecuteGraphAction() [D:\UE5Project\LiteRTDemo\Source\UmgMcp\Private\Blueprint\UmgBlueprintFunctionSubsystem.cpp:2899]
UnrealEditor_UmgMcp!UUmgBlueprintFunctionSubsystem::HandleBlueprintGraphAction() [D:\UE5Project\LiteRTDemo\Source\UmgMcp\Private\Blueprint\UmgBlueprintFunctionSubsystem.cpp:2746]
UnrealEditor_UmgMcp!UUmgMcpBridge::InternalExecuteCommand() [D:\UE5Project\LiteRTDemo\Source\UmgMcp\Private\Bridge\UmgMcpBridge.cpp:651]
UnrealEditor_UmgMcp!UUmgMcpBridge::ProcessNextQueuedCommand() [D:\UE5Project\LiteRTDemo\Source\UmgMcp\Private\Bridge\UmgMcpBridge.cpp:326]
UnrealEditor_Core
UnrealEditor_Core

Expected behavior

bluecode_apply should either create the call node, or return a structured failure if the selected function cannot be created without a Target/self pin context. It should not crash the editor.

Notes

Adjacent operations that were successful in the same asset before the crash:

  • create_widget and set_widget_properties
  • adding member variables with bluecode_apply_variables
  • creating and wiring Download Gemma 4 E2B LiteRT-LM Model async action node
  • creating variable set nodes for simple assignments

This may be related to missing/null Target pin or class context handling in AddNode() for non-static Blueprint class functions created from a UMG widget event graph.

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