Fixed 'Name is null' error if glow color is not specified

This commit is contained in:
Om Choksi 2023-04-24 08:13:50 +05:30
parent 9b71d532f6
commit 2fa7c8c0f6
No known key found for this signature in database
GPG Key ID: 5B5E07C43970B43B

@ -359,7 +359,7 @@ public class DefaultCommand extends Command {
} }
NPCFunction npcFunction = FunctionFactory.findFunctionForName(args.get("type")); NPCFunction npcFunction = FunctionFactory.findFunctionForName(args.get("type"));
if (npcFunction.getName().equalsIgnoreCase("glow")) { if (npcFunction.getName().equalsIgnoreCase("glow")) {
npcFunction.doRunFunction(foundNPC, new FunctionContext.ContextWithValue(foundNPC, args.get("value"))); npcFunction.doRunFunction(foundNPC, new FunctionContext.ContextWithValue(foundNPC, args.get("value") != null ? args.get("value").toUpperCase() : "WHITE"));
} else { } else {
npcFunction.doRunFunction(foundNPC, new FunctionContext.DefaultContext(foundNPC)); npcFunction.doRunFunction(foundNPC, new FunctionContext.DefaultContext(foundNPC));
} }