Skip to content

Commit

Permalink
Handle null reward case in CoreBots to prevent potential errors
Browse files Browse the repository at this point in the history
  • Loading branch information
PUNK3DAF committed Nov 12, 2024
1 parent 1683b4d commit a4a6133
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions CoreBots.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1979,11 +1979,7 @@ public void RegisterQuests(params int[] questIDs)
if (activeQuest != null)
{
ItemBase? reward = InitializeWithRetries(() => activeQuest.Rewards.FirstOrDefault(r => r != null && r.Quantity < r.MaxStack));
rewardId = reward.ID;
if (reward != null)
{
rewardId = reward.ID;
}
rewardId = reward?.ID ?? -1;
}
}
Expand Down

0 comments on commit a4a6133

Please sign in to comment.