# GetOwner() for Collided BSP Primitive is null

**URL:** <https://forums.unrealengine.com/t/getowner-for-collided-bsp-primitive-is-null/389625>\
**Category:** World Creation\
**Tags:** raycasting, owner, unreal-engine, bsp, Collision, null, question\
**Created:** [March 31, 2017, 8:44pm UTC](https://forums.unrealengine.com/t/getowner-for-collided-bsp-primitive-is-null/389625 "2017-03-31T20:44:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Furinyx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Furinyx](https://forums.unrealengine.com/u/Furinyx)\
**Post date:** [March 31, 2017, 8:44pm UTC](https://forums.unrealengine.com/t/getowner-for-collided-bsp-primitive-is-null/389625/1 "2017-03-31T20:44:25Z")

</div>

I am guessing this is potentially intended behaviour but on collision with BSP brushes, a primitive component exists but using GetOwner() on the primitive component returns null.

I understand that likely means BSP brushes do not derive from AActor (is there a reason they were implemented this way while still making use of normal components?) but are there any other use-cases where a PrimitiveComponent would never have an owner?

Currently, when querying components, I have been using GetOwner() without first caching a local reference to null-check as I was under the impression a component could only exist as a subobject of an owning Actor (as objects cannot exist in the scene without deriving from AActor, as far as I am aware).

I encountered this through raycasting - I was caching the hit component for use later, where I need access to the owning actor; this caused my Editor to crash, leading me to discover GetOwner() returns null on hit components when raycasts collide with BSP brushes in the scene.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [April 3, 2017, 4:26pm UTC](https://forums.unrealengine.com/t/getowner-for-collided-bsp-primitive-is-null/389625/2 "2017-04-03T16:26:52Z")

</div>

Hey -

While I understand your thoughts on actors in a level, it is still a good idea to always check if the return value of a call (GetOwner() / GetWorld() / etc.) is valid before using it. That being said, I was able to reproduce the behavior you described, however BSP are not typically meant to be used as final assets in a level. They are mostly used to first prototype or block out a level before being replaced with or converted into a static mesh. Indeed, if you convert your BSP to a static mesh (Advanced dropdown under Brush Settings) you will get a valid owner returned.

Cheers

---

<div class="post-metadata">

**Author:** ![Furinyx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Furinyx](https://forums.unrealengine.com/u/Furinyx)\
**Post date:** [April 3, 2017, 11:25pm UTC](https://forums.unrealengine.com/t/getowner-for-collided-bsp-primitive-is-null/389625/3 "2017-04-03T23:25:58Z")

</div>

Thanks. Yeah I typically null-check any pointers before using them and I’m definitely not using BSPs as final assets. It just means, when prototyping with BSPs, if a null check isn’t in place it causes a complete crash.
