NullPointerException if a non-member chats on Discord when linking is required
metalshark opened this issue ยท 1 comments
The following exception is produced:
[DiscordSRV] [JDA] One of the EventListeners had an uncaught exception
java.lang.NullPointerException
at github.scarsz.discordsrv.listeners.DiscordChatListener.onGuildMessageReceived(DiscordChatListener.java:81)
at github.scarsz.discordsrv.dependencies.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:346)
at github.scarsz.discordsrv.dependencies.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:96)
at github.scarsz.discordsrv.dependencies.jda.internal.hooks.EventManagerProxy.handle(EventManagerProxy.java:64)
at github.scarsz.discordsrv.dependencies.jda.internal.JDAImpl.handleEvent(JDAImpl.java:151)
at github.scarsz.discordsrv.dependencies.jda.internal.handle.MessageCreateHandler.handleInternally(MessageCreateHandler.java:97)
at github.scarsz.discordsrv.dependencies.jda.internal.handle.SocketHandler.handle(SocketHandler.java:36)
at github.scarsz.discordsrv.dependencies.jda.internal.requests.WebSocketClient.onDispatch(WebSocketClient.java:853)
at github.scarsz.discordsrv.dependencies.jda.internal.requests.WebSocketClient.onEvent(WebSocketClient.java:741)
at github.scarsz.discordsrv.dependencies.jda.internal.requests.WebSocketClient.handleEvent(WebSocketClient.java:720)
at github.scarsz.discordsrv.dependencies.jda.internal.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:891)
at github.scarsz.discordsrv.dependencies.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:385)
at github.scarsz.discordsrv.dependencies.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:276)
at github.scarsz.discordsrv.dependencies.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:996)
at github.scarsz.discordsrv.dependencies.ws.client.ReadingThread.handleFrame(ReadingThread.java:755)
at github.scarsz.discordsrv.dependencies.ws.client.ReadingThread.main(ReadingThread.java:108)
at github.scarsz.discordsrv.dependencies.ws.client.ReadingThread.runMain(ReadingThread.java:64)
at github.scarsz.discordsrv.dependencies.ws.client.WebSocketThread.run(WebSocketThread.java:45)
I am assuming this is because event.getAuthor().getId()
is called without first checking the author isn't null.