From a1178d5d566eed51053fd3833a1596432b250564 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Tue, 29 Mar 2016 15:21:56 +1100 Subject: [PATCH] Don't raise an error when 'additional perms' are specified for a command which has no 'additional perms'. --- Commands/CommandOtherPerms.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Commands/CommandOtherPerms.cs b/Commands/CommandOtherPerms.cs index 72eee16bf..5939c21a5 100644 --- a/Commands/CommandOtherPerms.cs +++ b/Commands/CommandOtherPerms.cs @@ -103,9 +103,12 @@ namespace MCGalaxy { while ((line = r.ReadLine()) != null) { try { if (!line.StartsWith("#") && line.Contains(':')) { - string[] LINE = line.ToLower().Split(':'); - OtherPerms OTPE = Find(Command.all.Find(LINE[0]), int.Parse(LINE[1])); - Edit(OTPE, int.Parse(LINE[2])); + string[] parts = line.ToLower().Split(':'); + Command cmd = Command.all.Find(parts[0]); + + OtherPerms perms = Find(cmd, int.Parse(parts[1])); + if (perms == null && cmd != null) continue; // command has no additional perms, so skip + Edit(perms, int.Parse(parts[2])); } } catch (Exception ex) { Server.s.Log("Loading an additional command permission failed!!");