Accessing a table in a list of subclasses (unity)

Eeimiieee1/30/2023
Hello, i'm trying to change a value of a table during runtime.
I have a unity object called manager that is the main, which in turn contains a class called unit, unit contains a list with costumes, along with all the options in a table, where of inside there is a simple bool which i'd like to change from ALLOWED to DISABLED and vice versa, however when i try to access this during runtime it tells me that the object I try access doesn't exit even if i know it's there and, simplified it's something like this

var example = Manager.unit.costumeMap[0];
                    example.costumeTable.usingType = Manager.costumeTable.USING_TYPE.ALLOWED;


What I doing wrong?
Hhiyosilver1/30/2023
Really hard to say without seeing the actual code, but if it's telling you some object doesn't exist, I'd wager you are mistaken in thinking that it does 😄
Hhiyosilver1/30/2023
Have you tried setting a breakpoint and checking the values at each step? Apparently something isn't properly initialized when you think it should be.
AAntonC1/30/2023
some object in the chain must be null
AAntonC1/30/2023
you have to check for nulls
AAntonC1/30/2023
how you check that depends on whether it's a unity object or a simple object
Eeimiieee1/30/2023
What's the difference between checking them for nulls?
AAngius1/30/2023
Unity overloads null in some weird ways
AAngius1/30/2023
Where x == null might be true, but x is null might be false
AAntonC1/30/2023
x == null checks if x has been destroyed, or isn't assigned
Eeimiieee1/30/2023
Thanks so much I will see if doing those checks helps me