micartey / webhookly

Java Discord Webhooks
https://jitpack.io/#micartey/webhookly/master-SNAPSHOT
2 stars 2 forks source link

Optional embed parameters #1

Closed n0ct closed 1 week ago

n0ct commented 2 months ago

In the WebHook::execute method, the use of Optional.of instead of Optional.ofNullable is a problem. Indeed, this causes every parameter of the embed to become mandatory.

Caused by: java.lang.NullPointerException
        at java.util.Objects.requireNonNull(Objects.java:208) ~[?:?]
        at java.util.Optional.of(Optional.java:113) ~[?:?]
        at me.micartey.webhookly.DiscordWebhook.execute(DiscordWebhook.java:61) ~[le-play-server-utils-1.0-SNAPSHOT.jar:?]
        at ...

Try to define the minimum parameters and you will see the issue.

micartey commented 2 months ago

Definitely a big mistake. I'll fix this in a week, as I am currently unavailable. You are welcome to create a merge request if you need this faster than that.

micartey commented 2 months ago

Should be fixed, please check