DaAllexx/LogFilter — pull request #3 by WeaselSqueezer (2014-04-12 16:45:11+00:00)
Title: Update ConsoleFilter.java

I've noticed that it is possible for Craftbukkit to provide null parameters (specifically the message String). This may be a bug on their part, but it won't hurt to null check. It saves for some confusing stack traces that really have nothing to do with the original issue. Look at this stack trace:
[12:21:35] [Server thread/WARN]: Failed to handle packet for /127.0.0.1:5880
java.lang.NullPointerException
at de.logfilter.filter.ConsoleFilter.filter(ConsoleFilter.java:30) ~[?:?]
at de.logfilter.filter.ConsoleFilter.filter(ConsoleFilter.java:51) ~[?:?]
at org.apache.logging.log4j.core.filter.CompositeFilter.filter(CompositeFilter.java:231) ~[spigot.jar:git-Spigot-1387]
at org.apache.logging.log4j.core.filter.AbstractFilterable.isFiltered(AbstractFilterable.java:124) ~[spigot.jar:git-Spigot-1387]
at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:400) ~[spigot.jar:git-Spigot-1387]
at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:367) [spigot.jar:git-Spigot-1387]
at org.apache.logging.log4j.core.Logger.log(Logger.java:110) [spigot.jar:git-Spigot-1387]
at org.apache.logging.log4j.spi.AbstractLogger.error(AbstractLogger.java:609) [spigot.jar:git-Spigot-1387]
at org.bukkit.craftbukkit.v1_7_R2.util.ForwardLogHandler.publish(ForwardLogHandler.java:33) ~[spigot.jar:git-Spigot-1387]
at java.util.logging.Logger.log(Unknown Source) ~[?:1.7.0_12-ea]
at java.util.logging.Logger.doLog(Unknown Source) ~[?:1.7.0_12-ea]
at java.util.logging.Logger.log(Unknown Source) ~[?:1.7.0_12-ea]
at net.minecraft.server.v1_7_R2.PlayerConnection.handleCommand(PlayerConnection.java:990) ~[spigot.jar:git-Spigot-1387]
at net.minecraft.server.v1_7_R2.PlayerConnection.a(PlayerConnection.java:829) ~[spigot.jar:git-Spigot-1387]
at net.minecraft.server.v1_7_R2.PacketPlayInChat.a(PacketPlayInChat.java:28) ~[spigot.jar:git-Spigot-1387]
at net.minecraft.server.v1_7_R2.PacketPlayInChat.handle(PacketPlayInChat.java:65) ~[spigot.jar:git-Spigot-1387]
at net.minecraft.server.v1_7_R2.NetworkManager.a(NetworkManager.java:148) ~[spigot.jar:git-Spigot-1387]
at net.minecraft.server.v1_7_R2.ServerConnection.c(ServerConnection.java:77) [spigot.jar:git-Spigot-1387]
at net.minecraft.server.v1_7_R2.MinecraftServer.v(MinecraftServer.java:705) [spigot.jar:git-Spigot-1387]
at net.minecraft.server.v1_7_R2.DedicatedServer.v(DedicatedServer.java:273) [spigot.jar:git-Spigot-1387]
at net.minecraft.server.v1_7_R2.MinecraftServer.u(MinecraftServer.java:568) [spigot.jar:git-Spigot-1387]
at net.minecraft.server.v1_7_R2.MinecraftServer.run(MinecraftServer.java:474) [spigot.jar:git-Spigot-1387]
at net.minecraft.server.v1_7_R2.ThreadServerApplication.run(SourceFile:618) [spigot.jar:git-Spigot-1387]