fix : crash when current scene is null (#583)

Co-authored-by: Mathieu Bergounioux <Mathieu.Bergounioux@sectra.com>
This commit is contained in:
monsieur xx
2022-04-23 19:09:12 +02:00
committed by GitHub
parent a351e0142c
commit ad96ff4177

View File

@@ -374,6 +374,11 @@ func quit():
func _handle_direct_scene_run() -> void:
var current_scene_root: Node = get_tree().get_current_scene()
if current_scene_root == null:
# there's no 'current scene'
# e.g. you're opening escoria.tscn from the editor
return
if current_scene_root.filename == ProjectSettings.get_setting('application/run/main_scene'):
# This is a normal, full-game run, so there's nothing to do.
return