fixed bug where an undefined variable could be dereferenced

which could cause the server to choke.