From cd8b4b710f3de3948021603167cf600038184a9d Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Mon, 13 Apr 2020 11:05:46 +1000 Subject: [PATCH] Fix /cmdunload null erroring --- MCGalaxy/Commands/Command.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MCGalaxy/Commands/Command.cs b/MCGalaxy/Commands/Command.cs index 1b3ded866..c7e405d01 100644 --- a/MCGalaxy/Commands/Command.cs +++ b/MCGalaxy/Commands/Command.cs @@ -104,7 +104,9 @@ namespace MCGalaxy { grp.Commands.Remove(cmd); } - Alias.UnregisterDefaults(cmd); + // typically Command.Unregister(Command.Find("xyz")) + // So don't error if Command.Find returned null + if (cmd != null) Alias.UnregisterDefaults(cmd); return removed; }