Blueprint Runtime Error: "Accessed None trying to read property"

Hi, I’m pretty new to the engine, and despite everything working as intended (in the viewport that is, the code appears to be doing what I meant to achieve), I’m getting 2-4 Blueprint Runtime Errors pointing to a spefcific node in my code whenever I run a simulation. I’ve tried searching for solutions to the issue but everything I found either made no difference at all or caused crashes/infinite loops (like the isValid? check, for instance). I also tried countless different blueprint configurations in the forms of forEach/while loops, branches, sequences and so on but I can’t seem to get it right.

The full error message reads as follows:

Blueprint Runtime Error: “Accessed None trying to read property SelectedDoorSpawn”. Node: SpawnActor Door Test Graph: EventGraph Function: Execute Ubergraph Dungeon Generator V2 Blueprint: Dungeon_Generator_V2

Here’s a couple snippets of my blueprint code where the issue seems to occur:

Thank you in advance for any replies.

2 Likes

Hello,

I would add an IS_VALID? node between the RANDOM and SELECT_DOOR_SPAWN nodes to make sure that the variable being pulled from the RANDOM node exists, and then pulling from the true condition, I would place a PRINT_STRING node right after the SELECT_DOOR_SPAWN node, connecting the output pin of the latter into the input of the former.

This way you can test if the variable exists.

Add a PRINT_STRING to the false condition that notifies you that a check has failed.

2 Likes

Hello and thank you for your reply! Following your advice, I first placed the isValid? node there as well as the printString on false; then I placed the second printstring in between the set and the spawn actor and got something at last:

PIE: Server logged in
PIE: Play in editor total start time 0.11 seconds.
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Running Timer
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_41.Exit3
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] IS_NOT_VALID
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_62.Exit2
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_62.Exit3
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_10.Exit1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_23.Exit1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_22.Exit1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_10.Exit3
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_50.Exit2
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_60.Exit5
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_61.Exit4
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_52.Exit3
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_31.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_60.Exit4
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_33.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_32.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_61.Exit5
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_23.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_30.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_10.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_25.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_11.Exit1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_27.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_37.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_51.Exit3
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_10.Exit2
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_61.Exit2
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_34.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] IS_NOT_VALID
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_30.Exit1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_22.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_26.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_24.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_20.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_35.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_11.Exit3
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_11.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_21.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_36.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064]
PIE: Error: Blueprint Runtime Error: “Accessed None trying to read property SelectedDoorSpawn”. Node: SpawnActor Door Test Graph: EventGraph Function: Execute Ubergraph Dungeon Generator V2 Blueprint: Dungeon_Generator_V2
PIE: Error: Blueprint Runtime Error: “Accessed None trying to read property SelectedDoorSpawn”. Node: SpawnActor Door Test Graph: EventGraph Function: Execute Ubergraph Dungeon Generator V2 Blueprint: Dungeon_Generator_V2
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_60.Exit3
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_12.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon complete!
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_22.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_52.Exit3
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_60.Exit4
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_10.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_41.Exit3
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_11.Exit1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_27.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_62.Exit2
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_20.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_37.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064]
PIE: Error: Blueprint Runtime Error: “Accessed None trying to read property SelectedDoorSpawn”. Node: SpawnActor Door Test Graph: EventGraph Function: Execute Ubergraph Dungeon Generator V2 Blueprint: Dungeon_Generator_V2
PIE: Error: Blueprint Runtime Error: “Accessed None trying to read property SelectedDoorSpawn”. Node: SpawnActor Door Test Graph: EventGraph Function: Execute Ubergraph Dungeon Generator V2 Blueprint: Dungeon_Generator_V2
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_26.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_32.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_50.Exit2
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_51.Exit3
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_10.Exit1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_25.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_23.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_61.Exit2
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_60.Exit5
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_21.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_61.Exit4
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_62.Exit3
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_10.Exit2
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_24.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_10.Exit3
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_61.Exit5
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_22.Exit1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_23.Exit1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_34.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_35.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_11.Exit3
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_33.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_30.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_12.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_30.Exit1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_11.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_31.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Room_60.Exit3
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon_Corridor_36.Junction1
LogBlueprintUserMessages: [Dungeon_Generator_V2_C_UAID_3C7C3FBA2C4649F901_1554732064] Dungeon complete!

What else could I try to troubleshoot this?

What is printing on the screen (not the log) when your game is active?

A video of gameplay would REALLY help so I can see what’s going on, because I don’t know what other things you have happening behind the scenes.

Alright, I tried recording what’s going on in game, but I don’t think that’s much to go on by. If it acts up sometimes it’s because the logic in some parts of my code is flawed, so it just gets stuck re-creating overlapping rooms sometimes (it has a 20 seconds timer before it restarts itself), but that’s besides the point. Here you go anyways

Error video

Thank you!

That cleared things up for me.

Look at what the PRINT_STRINGS are telling you. You got “IS_NOT_VALD” multiple times, which means that one or more of the members of your array do not exist or are empty. This is what’s causing the error.

Okay, so now you have to figure out which indices are not valid.

You can actually see that “IS_NOT_VALID” is printed to the screen four times, and once you exit game mode, you get four errors.

Try enabling this in Editor Preference:

It should break where the access none is taking place.

1 Like

I don’t get it though, how am I parsing a null value when the while loop condition is for the list not to be empty?

I did, it points me to the same spawn actor door node I highlit in yellow in my first screenshot, but I cannot figure out what’s causing it, it’s what I’m trying to understand here; to the best of my knowledge this could either be the intersections list variable being invalid, or the door blueprint itself, but I don’t see how either of those things could happen…

I don’t have access to your list, so I cannot tell you.

You may have spelled something wrong, deleted something, moved something… I don’t know. It’s your project.

I’d have to read through all of your code, and I’m not about to do that.

Test each index one by one.

Then when you find out what is causing the problem, deal with it accordingly.

If you don’t know how to do this, here’s an example (I created a CUSTOM_EVENT, but you can use the EVENT_BEGIN_PLAY node to execute this function):

One thing that immediately jumps out here:

Is the random evaluation, you’re accessing it twice. It means that you check if one random item in the array is valid but then generate another random valid and assign it as Selected - if you had any invalid entries in the array, it might be one of them.


We can see you append a bunch of arrays, perhaps you could explain how you populate them to start with?

Hi, I think I get what you mean, but how am I to set the variable and checking if it’s valid if that’s the case? If there’s a way to do both things sequentially, that is.

About the appends, I’m simply just moving elements from other arrays as they get picked, like this:

Again, I’m pretty sure all the arrays work as the final code does everything it’s supposed to do… I just find the errors in the output log annoying.

Thank you for your input!

I tried doing that but I’ve no idea what this all means nor how it’s any helpful… I now know there’s array elements that aren’t valid for whatever reason but no clue how they got into the array in the first place nor how to avoid picking them…

I believe a better question here is: why do you have invalid stuff in the array to start with?

But you wrote the script, right? How do you populate the array? There are some questions here only you can answer.

I have absolutely no idea! The arrays are made up of “exits” and “junction” points from each corridor/room, which are just arrows pointing to a direction, from which I gather the world transform to connect other rooms/corridors.

In short: I’m getting objects to obtain their positions to spawn meshes in that location and orientation (so that they appear seamlessly connected), nothing more, nothing less… Again, it works just fine for the dungeon generation, as well as for the door generation itself, but the latter is giving me these log errors for some unknown reason

Are these reference objects persistent or are they spawned themselves?

Do you have more than one level? (ie. Sublevels?)

Did you create this project from scratch or is it something prebuilt that you’re building on?

The reference objects are just simple meshes that give the spawner a translation to work with, correct? Then are you absolutely certain they aren’t destroyed or despawned at any point in time?

  • The objects are spawned via custom events, in a sequence; the whole level gets generated randomly each time

  • No, I do not. It’s the only level

  • I got the idea from a video tutorial, on top of which I added my own ideas (different elevation, separation between corridors and rooms, as well as adding these doors at every intersection).
    If it’s any helpful my code is based off of this.

  • The reference objects are just arrow components from the basic actor editor, from which I gather the current world transform, correct. Some of them are getting destroyed, but they don’t make it into the lists if that happens, as they are discarded at an earlier point in a branch.

THIS is a problem, because if you are randomizing the array, then you can draw from items that do not exist yet. That’s why I asked.

You need to validate the existence of the object BEFORE attempting to extract its translation.

You’re playing with fire, my dude. In theory, what you are trying to do SHOULD work, but unless your code is AIRTIGHT, you WILL get errors.

Like I mentioned above, make absolutely certain these reference items exist BEFORE adding them to the array (I’m guessing you’re using the APPEND node to do this) by utilizing VALIDATED GETS or IS_VALIDs.

1 Like

It appears I messed up the debug function earlier, managed to fix it and got some accurate results:

Interestingly, it’s only one index value causing both errors, and it always seems to be the array index 0 item. Could that mean anything?

Unfortunately, I have no idea. Again, not my project.

You have to make sense of where the error is pointing you. Usually there’s a pop-up window that appears (with errors) when you enter and exit Play Mode. There, there’s usually a hyperlink that takes you directly to the source of the problem.

“GET_ITEM_6”, whatever that means, doesn’t exist yet.