Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

The ReadyEventHandler´s user parameter can be null? #37

Open
ErdbeerbaerLP opened this issue May 10, 2019 · 0 comments
Open

The ReadyEventHandler´s user parameter can be null? #37

ErdbeerbaerLP opened this issue May 10, 2019 · 0 comments

Comments

@ErdbeerbaerLP
Copy link

ErdbeerbaerLP commented May 10, 2019

Describe the bug

When this library calls the ReadyEvent from the discordEventHandlers the DiscordUser can return null. I used this code:

builder.setReadyEventHandler((usr)->{
	DRPCLog.Info("READY! Logged in as "+usr.username);
});

This causes this error:

[20:36:59] [Discord Update Thread/INFO] [STDERR]: [com.sun.jna.Native$1:uncaughtException:123]: JNA: Callback de.erdbeerbaerlp.discordrpc.Discord$$Lambda$52/1650171715@7a4764bb threw the following exception:
[20:36:59] [Discord Update Thread/INFO] [STDERR]: [com.sun.jna.Native$1:uncaughtException:124]: java.lang.NullPointerException
[20:36:59] [Discord Update Thread/INFO] [STDERR]: [com.sun.jna.Native$1:uncaughtException:124]: 	at de.erdbeerbaerlp.discordrpc.Discord.lambda$0(Discord.java:57)
[20:36:59] [Discord Update Thread/INFO] [STDERR]: [com.sun.jna.Native$1:uncaughtException:124]: 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[20:36:59] [Discord Update Thread/INFO] [STDERR]: [com.sun.jna.Native$1:uncaughtException:124]: 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[20:36:59] [Discord Update Thread/INFO] [STDERR]: [com.sun.jna.Native$1:uncaughtException:124]: 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[20:36:59] [Discord Update Thread/INFO] [STDERR]: [com.sun.jna.Native$1:uncaughtException:124]: 	at java.lang.reflect.Method.invoke(Method.java:498)
[20:36:59] [Discord Update Thread/INFO] [STDERR]: [com.sun.jna.Native$1:uncaughtException:124]: 	at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:520)
[20:36:59] [Discord Update Thread/INFO] [STDERR]: [com.sun.jna.Native$1:uncaughtException:124]: 	at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:551)
[20:36:59] [Discord Update Thread/INFO] [STDERR]: [com.sun.jna.Native$1:uncaughtException:124]: 	at com.sun.jna.Native.invokeVoid(Native Method)
[20:36:59] [Discord Update Thread/INFO] [STDERR]: [com.sun.jna.Native$1:uncaughtException:124]: 	at com.sun.jna.Function.invoke(Function.java:408)
[20:36:59] [Discord Update Thread/INFO] [STDERR]: [com.sun.jna.Native$1:uncaughtException:124]: 	at com.sun.jna.Function.invoke(Function.java:354)
[20:36:59] [Discord Update Thread/INFO] [STDERR]: [com.sun.jna.Native$1:uncaughtException:124]: 	at com.sun.jna.Library$Handler.invoke(Library.java:244)
[20:36:59] [Discord Update Thread/INFO] [STDERR]: [com.sun.jna.Native$1:uncaughtException:124]: 	at net.arikia.dev.drpc.$Proxy28.Discord_RunCallbacks(Unknown Source)
[20:36:59] [Discord Update Thread/INFO] [STDERR]: [com.sun.jna.Native$1:uncaughtException:124]: 	at net.arikia.dev.drpc.DiscordRPC.discordRunCallbacks(DiscordRPC.java:96)
[20:36:59] [Discord Update Thread/INFO] [STDERR]: [com.sun.jna.Native$1:uncaughtException:124]: 	at de.erdbeerbaerlp.discordrpc.Discord$1.run(Discord.java:30)

Source

https://github.com/ErdbeerbaerLP/DiscordRichPresence/blob/1.12/src/main/java/de/erdbeerbaerlp/discordrpc/Discord.java#L56

Versions (Must be completed):

  • OS Ver: Windows 10
  • Java Version:
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
  • Library Version: 1.6.2

Additional info

Minecraft Version: 1.12.2
Forge Version: 14.23.4.2705

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant