Hi!
I made a custom subclass of CommonButtonBase to fix the issue with text styling detailed at the bottom of this page. There’s been many instances of me trying to tweak something in one of these classes and Unreal throwing an error and booting me out.
CommonButton.cpp
#include "CommonButton.h"
#include "CommonTextBlock.h"
void UCommonButton::NativeOnCurrentTextStyleChanged()
{
Super::NativeOnCurrentTextStyleChanged();
CommonTextLabel->SetStyle(GetCurrentTextStyleClass());
};
CommonButton.h
#pragma once
#include "CoreMinimal.h"
#include "CommonButtonBase.h"
#include "CommonButton.generated.h"
UCLASS(Abstract, meta = (DisableNativeTick))
class UCommonButton : public UCommonButtonBase
{
GENERATED_BODY()
protected:
virtual void NativeOnCurrentTextStyleChanged() override;
UPROPERTY(BlueprintReadWrite, meta = (BindWidgetOptional))
class UCommonTextBlock* CommonTextLabel;
};
The Error:
Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000000
UnrealEditor_CommonUI
UnrealEditor_Trees!UCommonButton::NativeOnCurrentTextStyleChanged() [C:\Users\chase\Documents\GitHub\Trees\Source\Trees\Private\CommonButton.cpp:8]
UnrealEditor_CommonUI
UnrealEditor_UMG
UnrealEditor_UMG
UnrealEditor_UMGEditor
UnrealEditor_UMGEditor
UnrealEditor_UMGEditor
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
kernel32
ntdll
Can someone tell me what incredibly silly thing I’ve done so I can hit myself and get on with work, please? Thank you kindly.