Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

Commit a18af41

Browse files
author
Inkception
committed
Fix broken 2.0.3 build
1 parent dd2376f commit a18af41

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

serializers/gson/src/main/java/at/stefangeyer/challonge/serializer/gson/adapter/MatchQueryAdapter.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@ public JsonElement serialize(MatchQuery query, Type typeOfSrc, JsonSerialization
1515
JsonObject entity = new JsonObject();
1616

1717
if (query.getWinnerId() != null) {
18-
entity.addProperty("winner_id", query.getWinnerId());
18+
Object winnerId = query.getWinnerId();
19+
20+
// janky casting, but this should work for the time being
21+
if (winnerId instanceof Long) {
22+
entity.addProperty("winner_id", (long)query.getWinnerId());
23+
} else {
24+
entity.addProperty("winner_id", (String)query.getWinnerId());
25+
}
1926
}
2027

2128
if (query.getVotesForPlayer1() != null) {

0 commit comments

Comments
 (0)