Handled possible null ref
This commit is contained in:
parent
100d04cc67
commit
c6b78dba1d
@ -93,12 +93,12 @@ export class HealthController {
|
|||||||
const itemRemovesEffects = Object.keys(healingItemDbDetails[1]._props.effects_damage).length > 0;
|
const itemRemovesEffects = Object.keys(healingItemDbDetails[1]._props.effects_damage).length > 0;
|
||||||
if (itemRemovesEffects) {
|
if (itemRemovesEffects) {
|
||||||
// Check body parts effects against what the healing item can remove
|
// Check body parts effects against what the healing item can remove
|
||||||
const effectsOnBodyPart = Object.keys(bodyPartToHeal.Effects);
|
if (!bodyPartToHeal.Effects) {
|
||||||
if (!effectsOnBodyPart) {
|
|
||||||
this.logger.warning(`Tried to remove effects from body part: ${request.part} without effects`);
|
this.logger.warning(`Tried to remove effects from body part: ${request.part} without effects`);
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
const effectsOnBodyPart = Object.keys(bodyPartToHeal.Effects);
|
||||||
|
|
||||||
for (const effectKey of effectsOnBodyPart) {
|
for (const effectKey of effectsOnBodyPart) {
|
||||||
const matchingEffectFromHealingItem = healItemEffectDetails[effectKey];
|
const matchingEffectFromHealingItem = healItemEffectDetails[effectKey];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user