From 70894fe1a7df26d42bb945f03323dc553ad8e9db Mon Sep 17 00:00:00 2001 From: imjp94 Date: Sat, 1 May 2021 15:13:25 +0800 Subject: [PATCH] Fix switching between local/remote StateMachinePlayer when playing scene cause null exception --- addons/imjp94.yafsm/scenes/StateMachineEditor.gd | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/imjp94.yafsm/scenes/StateMachineEditor.gd b/addons/imjp94.yafsm/scenes/StateMachineEditor.gd index 14963c7..766f421 100644 --- a/addons/imjp94.yafsm/scenes/StateMachineEditor.gd +++ b/addons/imjp94.yafsm/scenes/StateMachineEditor.gd @@ -103,6 +103,11 @@ func _process(delta): set_debug_mode(false) return var stack = state_machine_player.get("Members/StackPlayer.gd/stack") + if not stack: + set_process(false) + set_debug_mode(false) + return + if stack.size() == 1: set_current_state(state_machine_player.get("Members/StackPlayer.gd/current")) else: