javadiscord / java-discord-api

A wrapper over the discord API to create bots using Java
GNU General Public License v3.0
7 stars 8 forks source link

`HttpRequestBuilder.PUT` throws `NullPointerException` when no body is specified #107

Closed NightTripperID closed 4 months ago

NightTripperID commented 4 months ago

Description of the Issue

When an HttpRequest is built using a bodyless DiscordRequestBuilder for a PUT, it throws NullPointerException

Reproduction Steps

Expected behavior When an HttpRequest for a PUT is built from a bodyless DiscordRequestBuilder, the object should build successfully and not throw NullPointerException This can be achieved by adding .body(HttpRequest.BodyPublishers.noBody()) to all DiscordRequest::create implementations that lack a body and are used in a PUT

Acceptance Criteria

WHEN HttpRequest::PUT is called THEN a NullPointerException should not be thrown

SquidXTV commented 4 months ago

Going to take care of this