ID:1703670
 
(See the best response by Unwanted4Murder.)
For an unknown reason, I receive this when I try executing the following command:

runtime error: Cannot execute null.Add().
proc name: Give Perk (/mob/admin/verb/Give_Perk)
source file: Perks.dm,166
usr: Star (/mob)
src: Star (/mob)
call stack:

mob/var/UPerks[] = list()

        verb
Give_Perk(mob/M in world)
set category = "Admin"
var/C = input("Choose the perk you shall give to [M].") as null|anything in Perks
if(C)
// M.UPerks+=C
M.UPerks.Add(C)
M<<"You were given [C] by [src]."
src<<"You gave [C] to [M]."
LogText("-Admin-[src.name]/[src.key] gave [M.name]/[M.key] the '[C]' perk.",0,1)


Edit: Line 166 is "M.UPerks.Add(C)"
Best response
mob/var/list/UPerks = new()


Maybe some rephrasing? It's been awhile since I've used DM and I don't feel like opening a test environment, but I think that should solve your issue.
It would be better to not initialize UPerks until it's used. That would probably solve your issue, too.

edit: removed unnecessary code
In response to Kaiochao
Is the commented part to be put in the verb?
In response to Unwanted4Murder
Sorry for the double post: that helped! Ty.
Ugh, it's giving me the same error (after it started working once more).

Funny enough it works for this:

            Give_Jutsu(mob/M in world)
set category = "Admin"
set name="Give Jutsu (Perk Form)"
var/C = input("Choose the Jutsu (Perk form) you shall give to [M].") as null|anything in WJutsus
if(C)
// M.UPerks+=C
M.Jutsusp.Add(C)
M<<"You were given [C] by [src]."
src<<"You gave [C] to [M]."
LogText("-Admin-[src.name]/[src.key] gave [M.name]/[M.key] the '[C]' Jutsu.",0,1)


mob/var/Jutsusp[] = list()

I'm not sure what issue you're experiencing anymore. Could you please elaborate?
In response to Unwanted4Murder
The same run time error stated in the first post.
Bump.
Are you testing with a new character or loading a savefile? If loading, could the variable be stored as null (from an earlier version of the code) in your savefile?
In response to DarkCampainger
I'm testing with a new character. My save & load system is also partially unresponsive at the moment.