From 3ad8fb6460dd8a71433ca976204b2a161a39299d Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Thu, 4 Jul 2019 14:12:36 -0700 Subject: [PATCH] Fix crash in tooltips --- src/battle-tooltips.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle-tooltips.ts b/src/battle-tooltips.ts index 64ae5dfb8..643a14823 100644 --- a/src/battle-tooltips.ts +++ b/src/battle-tooltips.ts @@ -269,8 +269,9 @@ class BattleTooltips { case 'zmove': { // move|MOVE|ACTIVEPOKEMON let move = this.battle.dex.getMove(args[1]); let index = parseInt(args[2], 10); - let pokemon = this.battle.mySide.active[index]!; + let pokemon = this.battle.mySide.active[index]; let serverPokemon = this.battle.myPokemon![index]; + if (!pokemon) return false; buf = this.showMoveTooltip(move, type === 'zmove', pokemon, serverPokemon); break; }