If certain signals were fired while no puzzle was active, a null pointer exception could cause a crash. I never saw this myself, as it would require something nonsensical like "a shark is smushed on the main menu screen," but it could potentially explain some of the crashes we're seeing on steam versions of the game.
Also added a null check for get_tree().current_scene. This method is only used in a demo, but we may as well check.
If certain signals were fired while no puzzle was active, a null pointer exception could cause a crash. I never saw this myself, as it would require something nonsensical like "a shark is smushed on the main menu screen," but it could potentially explain some of the crashes we're seeing on steam versions of the game.
Also added a null check for get_tree().current_scene. This method is only used in a demo, but we may as well check.