ForEachLoop Bug in widgets 4.12

I’m doing a dynamic inventory system and in the widget I added a foreachloop. But for some reason I kept getting a error saying.

Blueprint Runtime Error: Accessed None trying to read property MyCharacter from function: ‘ExecuteUbergraph_W_Inventory’ from node ForEachLoop in graph: EvenGraph in object: W_Inventory with description: Accessed None trying to read property MyCharacter

Blueprint Runtime Error: Accessed None from function: ‘ExecuteUbergraph_W_Inventory’ from node ForEachLoop in graph: EventGraph in object W_Inventory with description: Accessed None.

So I created a macro and copied the foreachloop and pasted and connected everything up and I don’t get a error.

"Accessed None trying to read property MyCharacter "

Your MyCharacter refference was not set and you tried to access it. That resulted in a Error.

I found it needed a pure cast to mycharacter to fix the foreachloop error. I did a variable and made the variable mycharacter

glad you figured it out =) you can Mark the Bug as Answered