Fix NPE for plugins without special log prefix (#294)

This commit is contained in:
JOO200
2020-09-25 15:19:30 +02:00
committed by Aikar
parent 85ea761654
commit 9c5e9fbcdd
@@ -92,7 +92,8 @@ public class BukkitCommandManager extends CommandManager<
@SuppressWarnings("JavaReflectionMemberAccess")
public BukkitCommandManager(Plugin plugin) {
this.plugin = plugin;
this.logger = Logger.getLogger(this.plugin.getDescription().getPrefix());
String prefix = this.plugin.getDescription().getPrefix();
this.logger = Logger.getLogger(prefix != null ? prefix : this.plugin.getName());
this.timingManager = TimingManager.of(plugin);
this.commandTiming = this.timingManager.of("Commands");
this.commandMap = hookCommandMap();