Fix crashes
This commit is contained in:
parent
8aa67a4444
commit
18e66e9af1
2 changed files with 3 additions and 3 deletions
|
@ -47,7 +47,7 @@ func _cleanup() -> void:
|
|||
func _pull_config() -> void:
|
||||
if core.config.headless:
|
||||
# Remove all scenes
|
||||
logger.verbf("sms", "Removing all scenes (triggered by headless mode)")
|
||||
if is_inside_tree(): logger.verbf("sms", "Removing all scenes (triggered by headless mode)")
|
||||
for scene in scenes: remove_scene(scene, true)
|
||||
|
||||
# Add a scene to some scene collection
|
||||
|
|
|
@ -92,11 +92,11 @@ func nuke_storage(autosave: bool = true) -> bool:
|
|||
if autosave: save_storage()
|
||||
return true
|
||||
|
||||
func get_key(key: String, default: Variant) -> Variant:
|
||||
func get_key(key: String, default: Variant = null) -> Variant:
|
||||
if !is_open:
|
||||
logger.errorf("storage", "Failed to get key: No storage file is open")
|
||||
return NAN
|
||||
logger.diagf("storage", "Returning storage key \"" + key + "\" (default='" + default + "')")
|
||||
logger.diagf("storage", "Returning storage key \"" + key + "\" (default='" + str(default) + "')")
|
||||
return storage.get(key, default)
|
||||
|
||||
func set_key(key: String, value: Variant, overwrite: bool = true, autosave: bool = true) -> bool:
|
||||
|
|
Loading…
Reference in a new issue