Fix !== null uses

This commit is contained in:
Dean 2025-03-19 19:52:49 -07:00
parent 585f040057
commit 14610d07f0

View File

@ -3860,7 +3860,7 @@ export class PostTurnStatusHealAbAttr extends PostTurnAbAttr {
}
override canApplyPostTurn(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): boolean {
return (pokemon.status !== null) && this.effects.includes(pokemon.status.effect) && !pokemon.isFullHp();
return !Utils.isNullOrUndefined(pokemon.status) && this.effects.includes(pokemon.status.effect) && !pokemon.isFullHp();
}
/**
@ -4103,7 +4103,7 @@ export class FetchBallAbAttr extends PostTurnAbAttr {
}
override canApplyPostTurn(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): boolean {
return !simulated && globalScene.currentBattle.lastUsedPokeball !== null && !!pokemon.isPlayer;
return !simulated && !Utils.isNullOrUndefined(globalScene.currentBattle.lastUsedPokeball) && !!pokemon.isPlayer;
}
/**