From a4a6133f645f8436df5594b7507b7d2e549d5ac5 Mon Sep 17 00:00:00 2001 From: Vld Mrk Date: Tue, 12 Nov 2024 20:34:12 +0100 Subject: [PATCH] Handle null reward case in CoreBots to prevent potential errors --- CoreBots.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/CoreBots.cs b/CoreBots.cs index f1a7ac821..cb868f254 100644 --- a/CoreBots.cs +++ b/CoreBots.cs @@ -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; } }