# Why is BlackboardAsset a nullptr?

**URL:** <https://forums.unrealengine.com/t/why-is-blackboardasset-a-nullptr/360751>\
**Category:** AI\
**Tags:** Behavior-Tree, blackboard, aicontroller, unreal-engine, question\
**Created:** [June 14, 2016, 1:24pm UTC](https://forums.unrealengine.com/t/why-is-blackboardasset-a-nullptr/360751 "2016-06-14T13:24:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_f7974f53](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f7974f53](https://forums.unrealengine.com/u/anonymous_user_f7974f53)\
**Post date:** [June 14, 2016, 1:24pm UTC](https://forums.unrealengine.com/t/why-is-blackboardasset-a-nullptr/360751/1 "2016-06-14T13:24:10Z")

</div>

I’m starting to work myself into AI programming and currently work on a very basic BehaviorTree setup to understand all the interactions between the AI Controller, the BehaviorTree and the Blackboard. What I want to achieve is making an AI character move to a waypoint that’s been placed in the scene.  
However, the game crashes as soon as I press the Play button in the UE4 editor.  
I’ve debugged into the code with Visual Studio and discovered the crash occurs within the InitializeBlackboard(UBlackboardData& NewAsset)-function.

My setup looks like this:  
The AI character holds a BehaviorTree variable and is assigned the AI Controller. The BehaviorTree class from Epic has a BlackboardAsset variable to which I assigned my Blackboard in the BehaviorTree Editor.

The AI Controller holds a BehaviorTreeComponent and a BlackboardComponent. The BlackboardComponent class also has a BlackboardAsset variable that is being compared to the one I call the InitializeBlackboard-function with at the beginning of that function.  
And this is where the crash occurs.

 ![94596-2016-06-13_22h06_47.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/c/7/8c794e95e8e4e1b2a19b25929d7cefd8300ac42e.png)

 ![94597-2016-06-13_22h10_02.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/d/8/bd8d56cc83e0566494f2c51f14441ea992028723.png)

To my knowledge the only place where I have to assign my Blackboard is inside the BehaviorTree editor, which I did. Here is a screenshot to prove what I’ve set up using the Reference Viewer:

 ![94598-2016-06-13_22h22_34.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/f/e/dfea7d3daebcc17b25b60f15bfe2d26bf1c67a7f.png)

I also tried to encapsulate the if-statement that causes the crash where my asset gets compared to a nullpointer with another if-statement that checks for the nullpointer, but that just causes it to crash there instead.

 ![94599-2016-06-14_11h10_21.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/8/d/c8d86eee30ed3e2610449acc860eadbd6d15cd84.png)

I could try it with a try-catch-statement but I think I’ve got a pretty fundamental mistake somewhere. I’ve seen a lot of tutorials and followed the important bits step-by-step so I really don’t know where I went wrong. I’ll also attach my [Diagnostics.txt][5] file from a crash:

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![ash9991win](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ash9991win](https://forums.unrealengine.com/u/ash9991win)\
**Post date:** [June 14, 2016, 4:38pm UTC](https://forums.unrealengine.com/t/why-is-blackboardasset-a-nullptr/360751/2 "2016-06-14T16:38:33Z")

</div>

Are you creating the components in the constructor? Can you post the entire AIController code?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f7974f53](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f7974f53](https://forums.unrealengine.com/u/anonymous_user_f7974f53)\
**Post date:** [June 14, 2016, 6:18pm UTC](https://forums.unrealengine.com/t/why-is-blackboardasset-a-nullptr/360751/3 "2016-06-14T18:18:30Z")

</div>

I’m a ■■■■■■ and I love you. Cheers mate!
