Skip to content

Commit bb0cd7b

Browse files
authored
fix section not found (preferences) error (#1211)
1 parent 4ec31bc commit bb0cd7b

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/Autoload/Global.gd

+10-9
Original file line numberDiff line numberDiff line change
@@ -749,15 +749,16 @@ func _ready() -> void:
749749
current_project.fill_color = default_fill_color
750750

751751
# Load preferences from the config file
752-
for pref in config_cache.get_section_keys("preferences"):
753-
if get(pref) == null:
754-
continue
755-
var value = config_cache.get_value("preferences", pref)
756-
if pref == "grids":
757-
if value:
758-
update_grids(value)
759-
else:
760-
set(pref, value)
752+
if config_cache.has_section("preferences"):
753+
for pref in config_cache.get_section_keys("preferences"):
754+
if get(pref) == null:
755+
continue
756+
var value = config_cache.get_value("preferences", pref)
757+
if pref == "grids":
758+
if value:
759+
update_grids(value)
760+
else:
761+
set(pref, value)
761762
if OS.is_sandboxed():
762763
Global.use_native_file_dialogs = true
763764
await get_tree().process_frame

0 commit comments

Comments
 (0)