Skip to content

Commit 5fadcf1

Browse files
bugfix (#656)
1 parent 5db6c08 commit 5fadcf1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/poke_env/player/baselines.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ def choose_move(self, battle: AbstractBattle):
186186
active = battle.active_pokemon
187187
opponent = battle.opponent_active_pokemon
188188

189+
if active is None or opponent is None:
190+
return self.choose_random_move(battle)
191+
189192
# Rough estimation of damage ratio
190193
physical_ratio = self._stat_estimation(active, "atk") / self._stat_estimation(
191194
opponent, "def"

0 commit comments

Comments
 (0)