Okay, since I've been mentioned in this thread, let me clarify some stuff:
1) In order to implement plugin commands, one must alias the function
Game_Interpreter.prototype.pluginCommand, which receives the command and the arguments when called.
2) This function is indeed aliased by my Advanced Graphics plugin:
Code:
...
Khas.AL_Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
var handled = false;
switch (command.toLowerCase()) {
case "lighting":
...
3) The
command parameter is expected to be a String, thus I used the .toLowerCase() method on the
command parameter, so it's easier to check which command the user is calling
4) However, for some reason
completely unrelated to my plugin, the command variable is been passed as undefined or null. Then the crash happens and you see that error.
5) Please note that my plugin is the first on your plugins list, so it's also the first to alias the
Game_Interpreter.prototype.pluginCommand function. This means it's the last to receive the plugin
command and
args variables, so a lot can happen between the user calling a plugin command and the function being executed in my plugin.
6) My conclusion is that one of the two things below is happening:
a) RPG Maker may pass
command as undefined/null, then
every plugin maker must check them before using. If this is the case, it's indeed my error and I should have added a safety check before using the parameters.
b) RPG Maker passes
command as a string, always. Then some plugin in the middle is doing something weird with the parameters and passing them forward as null/undefined. If this is the case, even if my plugin didn't crash (supposing it had a safety check), you would have a buggy plugin somewhere doing things it isn't supposed to do.
My point is that
I already explained here what the problem was and that I will add a safety check to make my plugin more robust, even if this isn't my fault (again, my plugin is only showing that there's something wrong). I understand that plugin compatibility can be frustrating sometimes, but I wanted to make sure everyone on this thread understands what is happening and what the true problem is.
TL;DR; Always check the Game_Interpreter.prototype.pluginCommand parameters before using them xD
I've added a safety check in the next version of AdvancedGraphics, which will be released in a few days

Thanks for your patience, and please let me know if you have any further questions!