Skip to content

Commit

Permalink
NullChecking Userfetch
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasAunvik authored Feb 24, 2021
1 parent 44eeabb commit 0dc13e1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions AnimeListBot/Modules/Profile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ public async Task Leaderboard(int page = 1)
animeBoardField.Value += "\n";
}
IUser leadDiscordUser = Program._client.GetUser(animeLeadUser.UserId);
if(leadDiscordUser == null) continue;
animeBoardField.Value += "#" + (i + 1) + ": " + Format.Sanitize(animeLeadUser.GetAnimelistUsername()) + " (<@" + leadDiscordUser.Id + ">) - " + animeLeadUser.GetAnimeWatchDays() + " days";
}

Expand Down Expand Up @@ -447,6 +448,7 @@ public async Task Leaderboard(int page = 1)
}

IUser leadDiscordUser = Program._client.GetUser(mangaLeadUser.UserId);
if(leadDiscordUser == null) continue;
mangaBoardField.Value += "#" + (i + 1) + ": " + Format.Sanitize(mangaLeadUser.GetAnimelistUsername()) + " (<@" + leadDiscordUser.Id + ">) - " + mangaLeadUser.GetMangaReadDays() + " days";
}

Expand Down

0 comments on commit 0dc13e1

Please sign in to comment.