ID:146460
 
Code:
var/list/GMs = list()
var/list/Banned = list()
mob/pc
Login()
//deletes banned players
if(Banned.Find("[key]"))
src << "You have been banned from this server!!"
del(src)
//gives GMs their powers and whatnot
if(GMs.Find("[key]"))
src << "<font color=green>Welcome, your GM powers have been enabled"
src.verbs += typesof(/mob/GMs/verb)


Problem description:
I'm trying to add a key-based administration and banning system, it works by adding a persons key to the lists declared at the top. Problem is when I log in I get the following run-time error:

runtime error: Cannot execute null.Find().
proc name: Login (/mob/pc/Login)
usr: the pc (/mob/pc)
src: the pc (/mob/pc)
call stack:
the pc (/mob/pc): Login()
Fartmonger (/client): LoadChar()
Fartmonger (/mob/loading): Choose Char()
Fartmonger (/mob/loading): Login()

Is anyone able to tell me what's going on?

Don't abuse Find(), use the in operator.
In response to Hell Ramen
Hmmm... I think I found the problem anyway, the list was nullified when the world loaded because the file it was trying to load didn't exist, I solved it using the the if(fexists()) proc thingy.
In response to Fartmonger
Yeah, but if use "in" you won't even have to do all that stuff.
In response to Hell Ramen
It's still a good idea to at least make sure your list isn't null before you start doing anything with it.

And I'm glad to see a valid use of a /list proc is now a horrendous "abuse". There's nothing wrong with using list.Find(), but if you're not interested about list position, it is better to use in.
In response to tenkuu
It's not valid use though, even ask Lummox. Find() is used to return the index value, not to see if it's in the list.
In response to Hell Ramen
Hell Ramen wrote:
It's not valid use though, even ask Lummox. Find() is used to return the index value, not to see if it's in the list.

It can be used for either. Because, obviously - if it has an index, it's in the said list - if it doesn't, it returns "0".