Skip to content

Commit

Permalink
Fix Cannot read properties of null error
Browse files Browse the repository at this point in the history
  • Loading branch information
gc committed Oct 15, 2024
1 parent a0b10fd commit c46350b
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/tasks/minions/monsterActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,22 +511,22 @@ export const monsterTask: MinionTask = {
messages.push(...rawResults.filter(r => typeof r === 'string'));
const str = `${user}, ${user.minionName} finished killing ${quantity} ${monster.name} (${calcPerHour(data.q, data.duration).toFixed(1)}/hr), you now have ${newKC} KC.`;

announceLoot({
user,
monsterID: monster.id,
loot: itemTransactionResult!.itemsAdded,
notifyDrops: monster.notifyDrops
});
let image = undefined;

const image =
itemTransactionResult!.itemsAdded.length === 0
? undefined
: await makeBankImage({
bank: itemTransactionResult!.itemsAdded,
title: `Loot From ${quantity} ${monster.name}:`,
user,
previousCL: itemTransactionResult?.previousCL
});
if (itemTransactionResult && itemTransactionResult.itemsAdded.length > 0) {
announceLoot({
user,
monsterID: monster.id,
loot: itemTransactionResult.itemsAdded,
notifyDrops: monster.notifyDrops
});
image = await makeBankImage({
bank: itemTransactionResult.itemsAdded,
title: `Loot From ${quantity} ${monster.name}:`,
user,
previousCL: itemTransactionResult?.previousCL
});
}

return handleTripFinish(
user,
Expand Down

0 comments on commit c46350b

Please sign in to comment.