Im running into a blueprint runtime error with a null actor refrence

I have a variable, that is a custom blueprint object refrence, and it is sometimes null. Every tick, some data from it is used, but only if it is not null. I have used a macro to determine if it is null or not, and replace the data, so as to have only one get node for the variable(for debugging), and yet, I keep getting this error:

Blueprint Runtime Error: Accessed None trying to read property target_object from function: 'ExecuteUbergraph_BP_transit_route' from node: Set Beam Target Point in graph: EventGraph in object: BP_transit_route with description: Accessed None trying to read property target_object
Blueprint Runtime Error: Accessed None from function: 'ExecuteUbergraph_BP_transit_route' from node: LineTraceForObjects in graph: EventGraph in object: BP_transit_route with description: Accessed None
Blueprint Runtime Error: Accessed None trying to read property target_object from function: 'ExecuteUbergraph_BP_transit_route' from node: LineTraceForObjects in graph: EventGraph in object: BP_transit_route with description: Accessed None trying to read property target_object
Blueprint Runtime Error: Accessed None from function: 'ExecuteUbergraph_BP_transit_route' from node: Set Beam Target Point in graph: EventGraph in object: BP_transit_route with description: Accessed None

However, the code otherwise runs fine, it does what I want it to.

this is the macro,

these are where it is used

Check if actor is valid after getting it from the macro before doing anything with it.

the whole purpose of the macro is to check if it is valid, and then, if it is not, instead use information from the player, which is always valid, and set at spawntime. If null values were reaching the function, then they would not work properly, but they do. If you look at the third pic, this is in fact happening. It makes no difference.

Check it anyway. It’s quite clear that “Set Beam Target” is getting an invalid reference.

I did. I added a is valid execution node, and it continued to work, but the error still came through.

In macro, if Target Object is null, then return Connected Player, which can also be null. And think of the situation when both of those are null, what would you expect your macro to return? It still needs to be checked outside of macro. Consider using function and return control flow for a situation when everything is null.

Put a “Print String” at the exit of a macro, and see if prints a valid reference every single time.

it does, and the macro correctly prints the name of the actor(either the character, or the target when it is assigned) but the compiler still says that there is an invalid reference. I’m starting to think it is simply does not like a nil value anywhere, even if unused, in a backwards data chain. I have triple checked the validity of the values being passed into the functions, no invalid ones make it, but the error persists. It is starting to seem like an engine problem

I replicated this in a fresh project, and it appears to be a bug with the select node, which will somehow pass non-selected nil data, as well as the selected data, to whatever function it is attached to, and then the function returns the invalid data error, but works just fine, as it is given both the correct data and the nil data.

edit: if anyone cares to verify, that would be nice, for future people running into this bug.