Skip to content

Commit 3a48912

Browse files
Added null-check for experience goals on /{guild_id}/{user_id}
1 parent 6f6aae7 commit 3a48912

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/net/javadiscord/javabot/api/routes/user_profile/model/HelpAccountData.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ public class HelpAccountData {
3737
HelpAccountData data = new HelpAccountData();
3838
data.setExperienceCurrent(account.getExperience());
3939
Pair<Role, Double> previousRank = account.getPreviousExperienceGoal(guild);
40-
if (previousRank.first() != null) {
40+
if (previousRank != null && previousRank.first() != null) {
4141
data.setCurrentRank(previousRank.first().getName());
4242
data.setCurrentRankColor(ColorUtils.toString(previousRank.first().getColor()));
4343
data.setExperiencePrevious(previousRank.second());
4444
}
4545
Pair<Role, Double> nextRank = account.getNextExperienceGoal(guild);
46-
if (nextRank.first() != null) {
46+
if (nextRank != null && nextRank.first() != null) {
4747
data.setNextRank(nextRank.first().getName());
4848
data.setNextRankColor(ColorUtils.toString(nextRank.first().getColor()));
4949
data.setExperienceNext(nextRank.second());

0 commit comments

Comments
 (0)