Fixed getBTC() failing when Production area cannot be found

(cherry picked from commit 77b42bfb2f)
This commit is contained in:
Dev 2024-07-13 10:58:46 +01:00
parent 28fb1a2fc9
commit 2ea6b658fd

View File

@ -1138,7 +1138,7 @@ export class HideoutHelper
): void
{
// Get how many coins were crafted and ready to pick up
const craftedCoinCount = pmcData.Hideout.Production[HideoutHelper.bitcoinFarm].Products.length;
const craftedCoinCount = pmcData.Hideout.Production[HideoutHelper.bitcoinFarm]?.Products?.length ?? 0;
if (!craftedCoinCount)
{
const errorMsg = this.localisationService.getText("hideout-no_bitcoins_to_collect");