# Persistent EXCEPTION\_ACCESS\_VIOLATION on CommonButtonBase subclass

**URL:** <https://forums.unrealengine.com/t/persistent-exception-access-violation-on-commonbuttonbase-subclass/1244797>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, Widget, CPP, question\
**Created:** [July 30, 2023, 1:43pm UTC](https://forums.unrealengine.com/t/persistent-exception-access-violation-on-commonbuttonbase-subclass/1244797 "2023-07-30T13:43:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ditherling](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ditherling/32/1046192_2.png) [@ditherling](https://forums.unrealengine.com/u/ditherling)\
**Post date:** [July 30, 2023, 1:43pm UTC](https://forums.unrealengine.com/t/persistent-exception-access-violation-on-commonbuttonbase-subclass/1244797/1 "2023-07-30T13:43:57Z")

</div>

Hi!

I made a custom subclass of CommonButtonBase to fix the issue with text styling detailed [at the bottom of this page](https://benui.ca/unreal/common-ui-button/#applying-common-button-text-styles). 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

```auto
#include "CommonButton.h"
#include "CommonTextBlock.h"

void UCommonButton::NativeOnCurrentTextStyleChanged()
{
	Super::NativeOnCurrentTextStyleChanged();
	CommonTextLabel->SetStyle(GetCurrentTextStyleClass());
};

```

CommonButton.h

```auto
#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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![SolidSk](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/solidsk/32/1194513_2.png) [@SolidSk](https://forums.unrealengine.com/u/SolidSk)\
**Post date:** [July 31, 2023, 1:18am UTC](https://forums.unrealengine.com/t/persistent-exception-access-violation-on-commonbuttonbase-subclass/1244797/2 "2023-07-31T01:18:22Z")

</div>

Hi!  
Did you add _CommonUI_ module to your **ProjectName**.Build.cs file?

> **[UCommonButtonBase](https://docs.unrealengine.com/5.0/en-US/API/Plugins/CommonUI/UCommonButtonBase/)**
>
> Button that disables itself when not active.

```auto
PublicDependencyModuleNames.AddRange(new[] { "CommonUI" });

```
