Array that sometimes will return "None"

Hello,

Im super new to blueprints so this had me a bit stumped.
I have a dialog system, that sometimes can trigger choises based on your type of character (for example a Mage can have extra awnsers compared to a Warrior when talking to another Mage).
So in my UI Widget for the dialogsystem, I have a sequence that splits and adds all the “regular” awnsers and checks if your character is of any speciall kind.

If there is a speciall awnser (marked red on the image) I add them to my Array bind them to the click event and it’s all good.
But when playing Unreal complains that there is a “None” property in the Array.

So my question is, is there anyway to “Branch” check the “Make Array” to only include the speciall awnsers to the Array if there is one?

I can’t see enough code here, but I’d say you’re getting a problem from filling slot [1] of the array from a node that hasn’t been called.

Yes exactly it only get’s called some of the time. So how would I solve that? :slight_smile:

It is because you’re trying to fill the index [1] of your array with nothing, To fix it you could branch your for loop at the end of your sequence instead of after the “AddItem” function, like that you would be sure that all the code who fill the array will be executed before you iterate on it.

But I need to add them to the “On Clicked” event so if I Branch after the “sometimes filled” index[1] wont be a part of it?

From what I understand, I think you guys don’t understand what he’s asking. To me it sounds like you’re filling the variable with a special answer sometimes but only want to include it when it has a value. A trick I used is to duplicate the variable so it is the same object type, and name it something like ‘null’ or ‘none’, then you just don’t ever set it so it is always equal to none. Then you can create a branch and check if your variable is equal to the ‘none’ or ‘null’ variable, if it isn’t use it, if it’s not don’t.
Sorry if I’ve misinterpreted what you’re asking.

Yes! ^^
Thanks, I fixed it in a similar way with comparing and then adding ^^