[Bug] Fix Poison Heal Crash on beta (#5544)

Fix !== null uses
This commit is contained in:
Dean 2025-03-20 12:26:49 -07:00 committed by GitHub
parent b3c7300c37
commit 17e71a1b8a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

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;
}
/**