diff --git a/src/ui/egg-hatch-scene-handler.ts b/src/ui/egg-hatch-scene-handler.ts index 2d58054e999..7e6e7289712 100644 --- a/src/ui/egg-hatch-scene-handler.ts +++ b/src/ui/egg-hatch-scene-handler.ts @@ -32,8 +32,8 @@ export default class EggHatchSceneHandler extends UiHandler { processInput(button: Button): boolean { if (button === Button.ACTION || button === Button.CANCEL) { - const phase = this.scene.getCurrentPhase() as EggHatchPhase; - if (phase.trySkip()) + const phase = this.scene.getCurrentPhase(); + if (phase instanceof EggHatchPhase && phase.trySkip()) return true; }