Skip to content

Commit eb9a673

Browse files
committed
Update state.py
Ajout d'un check supplémentaire si juste un string au lieu d'un YAML malformé.
1 parent 7866266 commit eb9a673

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pyhilo/util/state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ async def get_state(state_yaml: str) -> StateDict:
136136
state_yaml_payload: StateDict | None = yaml.safe_load(content)
137137

138138
# Handle corrupted/empty YAML files
139-
if state_yaml_payload is None:
139+
if state_yaml_payload is None or not isinstance(state_yaml_payload, dict):
140140
LOG.warning(
141141
"State file %s is corrupted or empty, reinitializing with defaults",
142142
state_yaml,

0 commit comments

Comments
 (0)