mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 17:18:37 +01:00
Fix null log messages causing an NPE
This commit is contained in:
parent
ca4077b204
commit
5f5d65c463
@ -18,6 +18,9 @@ public class PaperLoggerProvider extends LoggerProvider {
|
||||
|
||||
@Override
|
||||
protected void doTheLog(Level level, String message, Throwable throwable) {
|
||||
if (message == null) {
|
||||
return;
|
||||
}
|
||||
final Component component = LegacyComponentSerializer.legacySection().deserialize(message);
|
||||
if (level == Level.SEVERE) {
|
||||
logger.error(component, throwable);
|
||||
@ -34,6 +37,9 @@ public class PaperLoggerProvider extends LoggerProvider {
|
||||
|
||||
@Override
|
||||
protected void doTheLog(Level level, String message) {
|
||||
if (message == null) {
|
||||
return;
|
||||
}
|
||||
final Component component = LegacyComponentSerializer.legacySection().deserialize(message);
|
||||
if (level == Level.SEVERE) {
|
||||
logger.error(component);
|
||||
|
Loading…
Reference in New Issue
Block a user