# \#nullptr

**URL:** https://forums.unrealengine.com/tag/nullptr/10419.md

[Latest](https://forums.unrealengine.com/latest.md) · [Categories](https://forums.unrealengine.com/categories.md) · [Tags](https://forums.unrealengine.com/tags.md)

---

## [GetLevelScriptActor() is null in packaged builds](https://forums.unrealengine.com/t/getlevelscriptactor-is-null-in-packaged-builds/2742010)

<div class="topic-metadata">

**Author:** [@DentonJC](https://forums.unrealengine.com/u/DentonJC)\
**Replies:** 0\
**Last updated:** [August 7, 2026, 6:20pm UTC](https://forums.unrealengine.com/t/getlevelscriptactor-is-null-in-packaged-builds/2742010 "2026-08-07T18:20:01Z")

</div>

I am finding that some of my levels are loading without any assigned LevelScriptActor. The level loads, its actors are initialized, its visible, but it has no LevelScriptActor, so no blueprint script code runs, no matter…

---

## [Access Violation error in BeginPlay, nullptr help?](https://forums.unrealengine.com/t/access-violation-error-in-beginplay-nullptr-help/2656939)

<div class="topic-metadata">

**Author:** [@NewDogPlus](https://forums.unrealengine.com/u/NewDogPlus)\
**Replies:** 6\
**Last updated:** [September 20, 2025, 2:16pm UTC](https://forums.unrealengine.com/t/access-violation-error-in-beginplay-nullptr-help/2656939 "2025-09-20T14:16:10Z")

</div>

I’ve been following along with an online class teaching how to make a third person shooter, and the current topic is about enemy behaviors and behavior trees. However, despite following along exactly with the code in the…

---

## [Custom UActorComponent is null](https://forums.unrealengine.com/t/custom-uactorcomponent-is-null/411822)

<div class="topic-metadata">

**Author:** [@intronaut](https://forums.unrealengine.com/u/intronaut)\
**Replies:** 3\
**Last updated:** [December 31, 2023, 2:26pm UTC](https://forums.unrealengine.com/t/custom-uactorcomponent-is-null/411822 "2023-12-31T14:26:49Z")

</div>

Hi Guys, I’ve encountered a weird problem: I have an ACharacter and I’ve added several UActorComponents to this ACharacter. Now when I try to access one of the Components, it’s null. The weird thing is that not all of…

---

## [UObject is still nullptr after being initialized in constructor](https://forums.unrealengine.com/t/uobject-is-still-nullptr-after-being-initialized-in-constructor/1406133)

<div class="topic-metadata">

**Author:** [@shue\_it](https://forums.unrealengine.com/u/shue_it)\
**Replies:** 2\
**Last updated:** [November 20, 2023, 3:36pm UTC](https://forums.unrealengine.com/t/uobject-is-still-nullptr-after-being-initialized-in-constructor/1406133 "2023-11-20T15:36:08Z")

</div>

Hello o/ I have two C++ classes (let say A and B class) which inherit from the same C++ parent class (let say AZ), which contains a custom Data variable (UMyData, which just inherit from UObject) In each constructor of…

---

## [Access to RootComponent not available](https://forums.unrealengine.com/t/access-to-rootcomponent-not-available/408736)

<div class="topic-metadata">

**Author:** [@Josai](https://forums.unrealengine.com/u/Josai)\
**Replies:** 2\
**Last updated:** [April 26, 2023, 4:46pm UTC](https://forums.unrealengine.com/t/access-to-rootcomponent-not-available/408736 "2023-04-26T16:46:18Z")

</div>

Hello, I have a Problem with the RootComponent of a class. I try to Get Access of the RootComponent of an AActor with GetRootComponent. Before I tried this I set a BoxComponent as RootComponent. But if I want to get acc…

---

## [Clarification about IsValid() and nullptr safety](https://forums.unrealengine.com/t/clarification-about-isvalid-and-nullptr-safety/761027)

<div class="topic-metadata">

**Author:** [@ZackAkai](https://forums.unrealengine.com/u/ZackAkai)\
**Replies:** 1\
**Last updated:** [February 1, 2023, 9:47am UTC](https://forums.unrealengine.com/t/clarification-about-isvalid-and-nullptr-safety/761027 "2023-02-01T09:47:11Z")

</div>

I was hoping to get a little clarification about best practices regarding safety checks for nullptrs. This is a function which returns the current game session: if(IsValid(GetWorld()) && (IsValid(GetWorld()-\>GetAuthGam…

---

## [GetCharacterMovement() returns nullptr](https://forums.unrealengine.com/t/getcharactermovement-returns-nullptr/466627)

<div class="topic-metadata">

**Author:** [@NedimH](https://forums.unrealengine.com/u/NedimH)\
**Replies:** 2\
**Last updated:** [October 19, 2022, 4:42am UTC](https://forums.unrealengine.com/t/getcharactermovement-returns-nullptr/466627 "2022-10-19T04:42:00Z")

</div>

Hello, I am experiencing a bizarre problem, where GetCharacterMovement() returns a nullptr when called from BeginPlay(). I have a big inheritance tree for my character class: ACharacter -\>AMICharacter-\>ABaseCharacter-\>…

---

## [TSharedPtr crash on exit game, traced to FWindowsApplication::ShutDownAfterError TaskbarList WindowsApplication.cpp line #234](https://forums.unrealengine.com/t/tsharedptr-crash-on-exit-game-traced-to-fwindowsapplication-shutdownaftererror-taskbarlist-windowsapplication-cpp-line-234/404508)

<div class="topic-metadata">

**Author:** [@GigasightMedia](https://forums.unrealengine.com/u/GigasightMedia)\
**Replies:** 7\
**Last updated:** [May 25, 2022, 5:52pm UTC](https://forums.unrealengine.com/t/tsharedptr-crash-on-exit-game-traced-to-fwindowsapplication-shutdownaftererror-taskbarlist-windowsapplication-cpp-line-234/404508 "2022-05-25T17:52:25Z")

</div>

Windows 7 64; MS VStudio 2015; Unreal Engine 4.17.1 I’ve been getting a crash when I exit my application, whether running PIE or standalone. I trigger application shutdown via Kismet: UKismetSystemLibrary::QuitGame…

---

## [Accessing function and variable of another C++ class nullptr problem](https://forums.unrealengine.com/t/accessing-function-and-variable-of-another-c-class-nullptr-problem/449071)

<div class="topic-metadata">

**Author:** [@Shayan.ebz99](https://forums.unrealengine.com/u/Shayan.ebz99)\
**Replies:** 12\
**Last updated:** [July 30, 2021, 6:23am UTC](https://forums.unrealengine.com/t/accessing-function-and-variable-of-another-c-class-nullptr-problem/449071 "2021-07-30T06:23:02Z")

</div>

hi everyone, i am really confused by some simple stuff, i am trying to get some values from class A and return that value into class B and do something with the value. first thing that came to mind was that i should crea…

---

## [Using SetPawn causes Access violation](https://forums.unrealengine.com/t/using-setpawn-causes-access-violation/480614)

<div class="topic-metadata">

**Author:** [@Neonzz](https://forums.unrealengine.com/u/Neonzz)\
**Replies:** 10\
**Last updated:** [March 20, 2021, 9:50pm UTC](https://forums.unrealengine.com/t/using-setpawn-causes-access-violation/480614 "2021-03-20T21:50:18Z")

</div>

Hello, Here is my issue I’ve just added a Dynamic\_Multicast\_delegate to my code SetPawn seems to be the best method to use for the listening function however when I hit play I get Acces Violation from the PlayerControll…

---

## [Pointer to Actor object becomes null for unknown reason](https://forums.unrealengine.com/t/pointer-to-actor-object-becomes-null-for-unknown-reason/478714)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_f7b3681e](https://forums.unrealengine.com/u/anonymous_user_f7b3681e)\
**Replies:** 0\
**Last updated:** [February 12, 2021, 10:49pm UTC](https://forums.unrealengine.com/t/pointer-to-actor-object-becomes-null-for-unknown-reason/478714 "2021-02-12T22:49:49Z")

</div>

Hey guys, I’m new to UE4 therefore I may be making a noob mistake/not understanding how UE4 works. I have also posted to UE4 forum at here asking for help, but wanted to gather more information here as well. Context: …

---

## [How to handle null pointers](https://forums.unrealengine.com/t/how-to-handle-null-pointers/477086)

<div class="topic-metadata">

**Author:** [@RemzDNB](https://forums.unrealengine.com/u/RemzDNB)\
**Replies:** 1\
**Last updated:** [January 11, 2021, 3:41pm UTC](https://forums.unrealengine.com/t/how-to-handle-null-pointers/477086 "2021-01-11T15:41:30Z")

</div>

Hey guys, quite new to C++ stuff here ! I was wondering, how do you handle invalid references without crashing the whole engine ? For example I’m loading a DataTable from my code with FObjectFinder and a hard path. I c…

---

## [UE4 C++ - Getting a nullptr in Playercontroller for a variable that is in BeginPlay() and works with variables used by BindAction but not if function is called from another class](https://forums.unrealengine.com/t/ue4-c-getting-a-nullptr-in-playercontroller-for-a-variable-that-is-in-beginplay-and-works-with-variables-used-by-bindaction-but-not-if-function-is-called-from-another-class/476927)

<div class="topic-metadata">

**Author:** [@KAo8o0S](https://forums.unrealengine.com/u/KAo8o0S)\
**Replies:** 2\
**Last updated:** [January 8, 2021, 8:33am UTC](https://forums.unrealengine.com/t/ue4-c-getting-a-nullptr-in-playercontroller-for-a-variable-that-is-in-beginplay-and-works-with-variables-used-by-bindaction-but-not-if-function-is-called-from-another-class/476927 "2021-01-08T08:33:12Z")

</div>

Hello all I have a pointer called “HUDPtr” to a HUD I created in the PlayerController.h. Then I added the “HUDPtr” in the BeginPlay() of the PlayerController.cpp. If I use the SetupInputComponent Keys I have defined and…

---

## [\[Crash\] Engine crashes when i open up bp's with Error: ECEPTION\_ACCESS\_VIOLATION reading address 0x000](https://forums.unrealengine.com/t/crash-engine-crashes-when-i-open-up-bps-with-error-eception-access-violation-reading-address-0x000/473097)

<div class="topic-metadata">

**Author:** [@Vanreus](https://forums.unrealengine.com/u/Vanreus)\
**Replies:** 1\
**Last updated:** [October 18, 2020, 3:34am UTC](https://forums.unrealengine.com/t/crash-engine-crashes-when-i-open-up-bps-with-error-eception-access-violation-reading-address-0x000/473097 "2020-10-18T03:34:10Z")

</div>

Hello, While working with some blueprints my engine crashed out of nowhere. Moreover, it doesn’t opens back up. It gives the same error over and over again. I changed the editor startup level to a blank one and finally …

---

## [Why is this a NULL pointer](https://forums.unrealengine.com/t/why-is-this-a-null-pointer/471578)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_04b5ac74](https://forums.unrealengine.com/u/anonymous_user_04b5ac74)\
**Replies:** 1\
**Last updated:** [September 19, 2020, 4:55am UTC](https://forums.unrealengine.com/t/why-is-this-a-null-pointer/471578 "2020-09-19T04:55:07Z")

</div>

\#It works in blueprints #But not in C++

---

## [Material editor crashing (nullptr error in UE4EditorCore.dll) after adding custom MaterialExpression class](https://forums.unrealengine.com/t/material-editor-crashing-nullptr-error-in-ue4editorcore-dll-after-adding-custom-materialexpression-class/469507)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_ed54c79a](https://forums.unrealengine.com/u/anonymous_user_ed54c79a)\
**Replies:** 0\
**Last updated:** [August 10, 2020, 12:39pm UTC](https://forums.unrealengine.com/t/material-editor-crashing-nullptr-error-in-ue4editorcore-dll-after-adding-custom-materialexpression-class/469507 "2020-08-10T12:39:49Z")

</div>

After addition of a new C++ class under UMaterialExpression (i.e. a custom material node), when I try to open any material editor, the UE4 editor crashes, reporting an error of reading nullptr in UE4EditorCore.dll. Thi…

---

## [GetOwner is returning null](https://forums.unrealengine.com/t/getowner-is-returning-null/468498)

<div class="topic-metadata">

**Author:** [@antonio\_gamedev](https://forums.unrealengine.com/u/antonio_gamedev)\
**Replies:** 4\
**Last updated:** [July 22, 2020, 8:41pm UTC](https://forums.unrealengine.com/t/getowner-is-returning-null/468498 "2020-07-22T20:41:10Z")

</div>

Hello, when I call the method GetOwner in the BeginPlay method I get a null pointer. This is only the code of the BeginPlay method. I have no idea why it is null. Can you give some hint? void ASTrackerBot::BeginPlay() …

---

## [What order are Controllers and Pawns/Characters instantiated?](https://forums.unrealengine.com/t/what-order-are-controllers-and-pawns-characters-instantiated/460003)

<div class="topic-metadata">

**Author:** [@CodingRook](https://forums.unrealengine.com/u/CodingRook)\
**Replies:** 5\
**Last updated:** [January 11, 2020, 6:38pm UTC](https://forums.unrealengine.com/t/what-order-are-controllers-and-pawns-characters-instantiated/460003 "2020-01-11T18:38:05Z")

</div>

During recent work on creating custom derived classes from PlayerController and Character, I ran into some nullpointer problems. Can anyone explain in clear manner, or point to clarifying documentation or other resource…

---

## [Preventing AudioComponent from being destroyed](https://forums.unrealengine.com/t/preventing-audiocomponent-from-being-destroyed/426200)

<div class="topic-metadata">

**Author:** [@Avengar](https://forums.unrealengine.com/u/Avengar)\
**Replies:** 1\
**Last updated:** [November 22, 2019, 2:11am UTC](https://forums.unrealengine.com/t/preventing-audiocomponent-from-being-destroyed/426200 "2019-11-22T02:11:00Z")

</div>

Hello there! Going straight to the problem. I’m trying to create UAudioComponent that can be paused and hold into memory until I decide to delete it. Now i have problem with it becouse after some time on level my sound …

---

## [Shooting direction in dedicated server if camera is nullptr](https://forums.unrealengine.com/t/shooting-direction-in-dedicated-server-if-camera-is-nullptr/451063)

<div class="topic-metadata">

**Author:** [@plato.manchi](https://forums.unrealengine.com/u/plato.manchi)\
**Replies:** 1\
**Last updated:** [June 21, 2019, 2:47pm UTC](https://forums.unrealengine.com/t/shooting-direction-in-dedicated-server-if-camera-is-nullptr/451063 "2019-06-21T14:47:43Z")

</div>

Hello, The way my current setup works is player press shoot and I send notification to server, then server uses the camera of player to get position and rotation and do a line trace (and apply bullet spray in future) an…

---

## [Custom Class UObject Reference Always Null](https://forums.unrealengine.com/t/custom-class-uobject-reference-always-null/446184)

<div class="topic-metadata">

**Author:** [@Geowil](https://forums.unrealengine.com/u/Geowil)\
**Replies:** 2\
**Last updated:** [March 29, 2019, 5:38am UTC](https://forums.unrealengine.com/t/custom-class-uobject-reference-always-null/446184 "2019-03-29T05:38:58Z")

</div>

Hello, I am having some issues attempting to get a working tech demo for some of the systems I will have in my game working. First let me describe what I am trying to do with the area that is not working. I have a few …

---

## [UWidget::IsHovered causes a crash](https://forums.unrealengine.com/t/uwidget-ishovered-causes-a-crash/446181)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_24db18e6](https://forums.unrealengine.com/u/anonymous_user_24db18e6)\
**Replies:** 1\
**Last updated:** [March 29, 2019, 4:52am UTC](https://forums.unrealengine.com/t/uwidget-ishovered-causes-a-crash/446181 "2019-03-29T04:52:47Z")

</div>

We have a custom UWidget class that represents an item in a menu. There are two places where we call IsHovered on that class and they both crash seemingly randomly. In the UUserWidget subclass that contains the menu ite…

---

## [4.22 preview5, FTextureRenderTargetCubeResource.ReadPixels crashes](https://forums.unrealengine.com/t/4-22-preview5-ftexturerendertargetcuberesource-readpixels-crashes/445145)

<div class="topic-metadata">

**Author:** [@Shirlman](https://forums.unrealengine.com/u/Shirlman)\
**Replies:** 0\
**Last updated:** [March 12, 2019, 11:13am UTC](https://forums.unrealengine.com/t/4-22-preview5-ftexturerendertargetcuberesource-readpixels-crashes/445145 "2019-03-12T11:13:13Z")

</div>

After enable dx12 for raytracing, ReadPixels crashes in 4.22 preview4, the following code work well in 4.21 code snippet： FTextureRenderTargetCubeResource\* CubeResource = (FTextureRenderTargetCubeResource\*)SceneCapture…

---

## [Crash sometimes occurs when retrieving a pointer from a TArray](https://forums.unrealengine.com/t/crash-sometimes-occurs-when-retrieving-a-pointer-from-a-tarray/442013)

<div class="topic-metadata">

**Author:** [@artboy77](https://forums.unrealengine.com/u/artboy77)\
**Replies:** 1\
**Last updated:** [January 24, 2019, 6:06pm UTC](https://forums.unrealengine.com/t/crash-sometimes-occurs-when-retrieving-a-pointer-from-a-tarray/442013 "2019-01-24T18:06:52Z")

</div>

for (int i = 0; i \< GrabbedPrimitives.Num(); i++) { if (i \>= GrabbedPrimitives.Num()) return; if (!IsValid(GrabbedPrimitives\[i\])) continue; UPrimitiveComponent\* GrabbedPrimitive = GrabbedPrimitives\[i\]; } Above is t…

---

## [Cast of nullptr to SceneComponent failed](https://forums.unrealengine.com/t/cast-of-nullptr-to-scenecomponent-failed/440896)

<div class="topic-metadata">

**Author:** [@RealMrYon](https://forums.unrealengine.com/u/RealMrYon)\
**Replies:** 0\
**Last updated:** [January 8, 2019, 8:05pm UTC](https://forums.unrealengine.com/t/cast-of-nullptr-to-scenecomponent-failed/440896 "2019-01-08T20:05:31Z")

</div>

Greetings, I am getting the following error when trying to package my project for Windows 64. Compile works just fine, but I get the following error: Cast of nullptr to SceneComponent failed I have attached the packag…

---

## [C++ best error handling practice?](https://forums.unrealengine.com/t/c-best-error-handling-practice/438687)

<div class="topic-metadata">

**Author:** [@Alessa](https://forums.unrealengine.com/u/Alessa)\
**Replies:** 2\
**Last updated:** [December 2, 2018, 1:30am UTC](https://forums.unrealengine.com/t/c-best-error-handling-practice/438687 "2018-12-02T01:30:36Z")

</div>

So I’ve been learning C++ the last few months, and given that I have certain values that are specified by designers exposed on a given class, I need to validate and ensure that these values aren’t nullptrs. Right now, t…

---

## [There's a bug in ChildActorComponent.cpp line 95 that causes package to fail](https://forums.unrealengine.com/t/theres-a-bug-in-childactorcomponent-cpp-line-95-that-causes-package-to-fail/420565)

<div class="topic-metadata">

**Author:** [@Feureau](https://forums.unrealengine.com/u/Feureau)\
**Replies:** 4\
**Last updated:** [October 27, 2018, 10:05am UTC](https://forums.unrealengine.com/t/theres-a-bug-in-childactorcomponent-cpp-line-95-that-causes-package-to-fail/420565 "2018-10-27T10:05:22Z")

</div>

Error: UATHelper: Packaging (Android (ETC1)): LogInit: Display: LogOutputDevice: Error: begin: stack for UAT UATHelper: Packaging (Android (ETC1)): LogInit: Display: LogOutputDevice: Error: === Handled ensure: === U…

---

## [Access violation with "null pointer check"](https://forums.unrealengine.com/t/access-violation-with-null-pointer-check/428038)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_0358ed391](https://forums.unrealengine.com/u/anonymous_user_0358ed391)\
**Replies:** 3\
**Last updated:** [June 26, 2018, 12:24pm UTC](https://forums.unrealengine.com/t/access-violation-with-null-pointer-check/428038 "2018-06-26T12:24:07Z")

</div>

I am getting random crashes in my project, all related to this line of code, that closes all doors: The error is a "Access violation - code c0000005 … " for (ATrainDoor\* TrainDoor : TrainDoors) { if(TrainDoor) TrainD…

---

## [Same pointer is valid in BP but null in C++](https://forums.unrealengine.com/t/same-pointer-is-valid-in-bp-but-null-in-c/423903)

<div class="topic-metadata">

**Author:** [@Arty-McLabin](https://forums.unrealengine.com/u/Arty-McLabin)\
**Replies:** 19\
**Last updated:** [May 14, 2018, 10:53am UTC](https://forums.unrealengine.com/t/same-pointer-is-valid-in-bp-but-null-in-c/423903 "2018-05-14T10:53:33Z")

</div>

The next uproperty component pointer: UPROPERTY(VisibleAnywhere, BlueprintReadWrite) USkeletalMeshComponent\* mesh; constructor code: mesh = CreateDefaultSubobject\<USkeletalMeshComponent\>(TEXT("mesh")); //succeeds all …

---

## [GetSocketByName() returns nullptr](https://forums.unrealengine.com/t/getsocketbyname-returns-nullptr/424937)

<div class="topic-metadata">

**Author:** [@Klaub](https://forums.unrealengine.com/u/Klaub)\
**Replies:** 0\
**Last updated:** [May 12, 2018, 11:59am UTC](https://forums.unrealengine.com/t/getsocketbyname-returns-nullptr/424937 "2018-05-12T11:59:06Z")

</div>

Hi, so I have a socket on my skeletal mesh called Hand\_RSocket, and I’m trying to attach a static mesh subobject to it with the following code: const USkeletalMeshSocket\* SwordSocket = this-\>GetMesh()-\>GetSocketByName…

[Next page](https://forums.unrealengine.com/tag/nullptr/10419.md?match_all_tags=true&page=1&tags%5B%5D=nullptr)
