✅ "Object reference not set to an instance of"

Title, I use a Interface to allow me to make a list of objects that require generic arguments, one problem is that while I don't think anything is out of the ordinary, and I do instantiate new variables + objects attached to said variables (I do use Godot but it's more of a C# help, as these are bare bare objects), and once I try to cycle the list, bam all hell breaks loose, dropping attachments now
10 Replies
𝐕𝐢𝐠𝐢𝐥
ConVar.cs
𝐕𝐢𝐠𝐢𝐥
Console.cs
No description
𝐕𝐢𝐠𝐢𝐥
the call
No description
𝐕𝐢𝐠𝐢𝐥
From my POV: I create the console, which upon initialization creates two new variables of the ConVar<T> type which implements IConVar (no issue?), and first add them to the list, THEN, try to list them with a foreach So the objects should already be made, instantiated with new, attached to a variable, and only once they've been added they're actually listed
Angius
Angius9mo ago
The list is not instantiated
𝐕𝐢𝐠𝐢𝐥
OHHH I'm STUPID LMAO
Angius
Angius9mo ago
You have a field of type List<T> but no actual List<T>
𝐕𝐢𝐠𝐢𝐥
Yeah, I realized now huge dumb dumb moment on my part, thanks
Angius
Angius9mo ago
Ok
Want results from more Discord servers?
Add your server
More Posts