ID:264665
 
Code:
world/New()
if(fexists("Config.sav"))
var/savefile/S=new("Config.sav")
S["Ban"]>>Banned

world/Del()
var/savefile/S=new("Config.sav")
S["Ban"]<<Banned

var
list/Banned=list()

mob/verb/Ban(mob/M as mob in world)
Banned.Add(M)

mob/verb/BanList()
for(var/mob/M in Banned)
usr<<"[M.key]"


Problem description:
runtime error: Cannot execute null.Add().
proc name: Ban (/mob/verb/Ban)
source file: GM.dm,21
usr: Zorro de las nueve colas (/mob)
src: Zorro de las nueve colas (/mob)
call stack:
Zorro de las nueve colas (/mob): Ban(Zorro de las nueve colas (/mob)), Obv This is a DEMO, not the Real Code.
If this isn't the real code then check the real code and look at where banned is defined. If it looks like that does it shouldn't be saying that. If it's just var/list/banned or var/list/banned[] it will cause that.
In response to Ulterior Motives
its var/list/Banned = list()
I've been testing it out and I'm not receiving this runtime error. So, I don't know, it's working perfect for me.
In response to Ulterior Motives
I get that runtime everytime i open the BanList
The savefile contains a null entry for "Ban", which ends up overriding the default of an empty (but non-null) list. You can catch it like so:

S["Ban"]>>Banned
if(!Banned) Banned = list()


Or, if you just delete Config.sav (while the world isn't running) it should fix itself.
In response to Garthor
oh Thanks Garthor. and Ulterior.
In response to Garthor
Garthor wrote:
The savefile contains a null entry for "Ban", which ends up overriding the default of an empty (but non-null) list. You can catch it like so:

S["Ban"]>>Banned
> if(!Banned) Banned = list()

Or, if you just delete Config.sav (while the world isn't running) it should fix itself.

I'm trying to understand this error. Would this be similar to a dangling pointer?
In response to Hulio-G
Not really, no. It's a null pointer error, which is considerably less severe. A dangling pointer is where you'd have a pointer pointing to a random block of memory. A null pointer is when it's pointing to null, or 0, which is perfectly valid so long as it's recognized as a "do not attempt to dereference this pointer" value.

Again, the issue was simply that the savefile had no entry for the value being read, so it just read out null into the list, overriding it, and then in the future saving the new value of null in the savefile.