From c1c8af5f6c5a4ac9bf0d061ca2aca2b1e5271051 Mon Sep 17 00:00:00 2001 From: frutescens Date: Wed, 25 Sep 2024 14:00:49 -0700 Subject: [PATCH] Check for this.source --- src/data/battler-tags.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 6fe2543b93e..a55aa368a8c 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -2543,7 +2543,9 @@ export class ImprisonTag extends MoveRestrictionBattlerTag { } override onAdd(pokemon: Pokemon) { - this.source = pokemon.scene.getPokemonById(this.sourceId!)!; + if (this.sourceId) { + this.source = pokemon.scene.getPokemonById(this.sourceId)!; + } } /**