Skip to content

Commit

Permalink
fix parsing stickers (#1692)
Browse files Browse the repository at this point in the history
This fixes issues with stickers that have null descriptions.
Discord be doing a little trolling on their stable api versions.
  • Loading branch information
sebm253 committed Jun 27, 2021
1 parent 990675b commit b336d57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ public String getName()
}

/**
* The description of the sticker.
* The description of the sticker or empty String if the sticker doesn't have one.
*
* @return the description of the sticker
* @return Possibly-empty String containing the description of the sticker
*/
@Nonnull
public String getDescription()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1463,7 +1463,7 @@ public MessageSticker createSticker(DataObject content)
{
final long id = content.getLong("id");
final String name = content.getString("name");
final String description = content.getString("description");
final String description = content.getString("description", "");
final long packId = content.getLong("pack_id", content.getLong("guild_id", 0L));
final String asset = content.getString("asset", "");
final MessageSticker.StickerFormat format = MessageSticker.StickerFormat.fromId(content.getInt("format_type"));
Expand Down

0 comments on commit b336d57

Please sign in to comment.