Vatuu / discord-rpc

Java Wrapper of the Discord-RPC Library for Discord Rich Presence.
MIT License
194 stars 42 forks source link

sh: 1: Syntax error: "(" unexpected when DiscordRPC.discordInitialize is called with applicationID being null #26

Closed liquidev closed 5 years ago

liquidev commented 5 years ago

Hello, I am trying to use this library in my application, but upon calling DiscordRPC.discordInitialize() with a null applicationID the library prints this in the error output stream:

sh: 1: Syntax error: "(" unexpected

Maybe a more meaningful error could be printed?

DeJayDev commented 5 years ago

I um. No idea what this error is. I blame discordapp, but I can research it for you.

What OS are you on?

liquidev commented 5 years ago

Ubuntu 18.04 LTS.

DeJayDev commented 5 years ago

Give me a moment, allow me to ask around.

Vatuu commented 5 years ago

You probably expected this, but this library is relying on the original discord-rpc C++ library. We interact with it through the JNA interface. Due to this, exact arguments need to be passed. The library expects a String for the appId, and JNA is redirecting this, but since it's unable to accept null, it takes care of error handling, which leads to JNA freaking out.

So yeah, technically this is on JNA, and I don't see much use of null-checking a value that should be a static String.

Thanks for reporting though.

liquidev commented 5 years ago

@DeJayDevelopment Sure, ask what you need. Other things I thought may be important: