Chat Commands Module

raBBish made a chat command module and it works. But if you just type in the character prefix and no command or arguments, it errors with this:

[lua]
Hook ‘ChatCommand.ParseChat’ Failed: [gamemodes\gamemode_test\gamemode\chatcommand.lua:25] attempt to index local ‘command’ (a nil value)
[/lua]

http://www.facepunch.com/threads/927717-Chat-Commands
There’s his thread.

When this error happens, the entire thing breaks. Which is bad, seeing how it’s very easy to do.

I didn’t know if I should post the problem here, or in the original thread. It seemed old, so I didn’t know if I should bump it or not.
I like to think of myself as a decent coder, but I haven’t been able to fix it. I don’t mess with modules, even though it’s still lua. Just the code in it makes my head go all [img_thumb] http://planetsmilies.net/confused-smiley-17559.gif [/img_thumb]

Try replacing the chatcommand.lua with this: http://pastebin.com/Jma12fg6

I can’t try it myself, don’t have GMod installed. If it works, I’ll update the old download.