From 0956595c9678ee6bd2261518f98a61ea05c8304c Mon Sep 17 00:00:00 2001 From: DegradingAnt <283642604+DegradingAnt@users.noreply.github.com> Date: Sun, 16 Aug 2026 19:42:03 +0200 Subject: [PATCH] Fix null dereference when hooking a vertical box with a generic slot UWidgetBlueprintHookSlot_Generic::SetupPanelSlot dereferences HorizontalBoxSlot inside the UVerticalBoxSlot branch. That variable belongs to the preceding else-if, so it is always null by the time the vertical box branch runs. Any mod that registers a widget hook whose parent is a vertical box and whose slot configuration is the generic one will crash the game during UGameInstance::Init, before the main menu appears. The access violation reads address 0x38, which is the offset of the member SetSize touches on a null this. The other branches in the function each call their own slot's setters, so this looks like a copy-paste from the horizontal box branch above. --- .../Source/SML/Private/Patching/WidgetBlueprintHookManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mods/SML/Source/SML/Private/Patching/WidgetBlueprintHookManager.cpp b/Mods/SML/Source/SML/Private/Patching/WidgetBlueprintHookManager.cpp index db02d6d8ca..d662f2d6c3 100644 --- a/Mods/SML/Source/SML/Private/Patching/WidgetBlueprintHookManager.cpp +++ b/Mods/SML/Source/SML/Private/Patching/WidgetBlueprintHookManager.cpp @@ -110,7 +110,7 @@ void UWidgetBlueprintHookSlot_Generic::SetupPanelSlot(UPanelSlot* InPanelSlot) { ScaleBoxSlot->SetHorizontalAlignment(HorizontalAlignment); ScaleBoxSlot->SetVerticalAlignment(VerticalAlignment); } else if (UVerticalBoxSlot* VerticalBoxSlot = Cast(InPanelSlot)) { - HorizontalBoxSlot->SetSize(Size); + VerticalBoxSlot->SetSize(Size); VerticalBoxSlot->SetPadding(Padding); VerticalBoxSlot->SetHorizontalAlignment(HorizontalAlignment); VerticalBoxSlot->SetVerticalAlignment(VerticalAlignment);