Skip to content

Commit

Permalink
Fix null reference
Browse files Browse the repository at this point in the history
  • Loading branch information
svr333 committed Jan 25, 2024
1 parent 4347e36 commit 4529d17
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/AdvancedBot.Core/Commands/Modules/TelemetryModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Linq;
using System.Threading.Tasks;
using AdvancedBot.Core.Commands.Preconditions;
using AdvancedBot.Core.Entities;
using AdvancedBot.Core.Services;
using Discord;
using Discord.Interactions;
Expand Down Expand Up @@ -66,6 +67,12 @@ public async Task GetPossibleAltsAsync(uint userId)
var result = await ModService.GetPossibleAlts(Context.User.Id, userId);
var user = await GLService.GetUserProfileAsync(userId.ToString());

if (user.User == null)
{
await SendResponseMessage(new ResponseMessage() { Content = "No Galaxy Life Data for this user." }, false);
return;
}

var fields = new List<EmbedField>();

for (int i = 0; i < result.Output.Count; i++)
Expand Down

0 comments on commit 4529d17

Please sign in to comment.