mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-09 18:39:04 +08:00
Fix: read_file() may return an empty list
This commit is contained in:
parent
6a7c049f9c
commit
128d9d27d8
@ -96,6 +96,8 @@ def read_file(file):
|
||||
data = list(yaml.safe_load_all(s))
|
||||
if len(data) == 1:
|
||||
data = data[0]
|
||||
if not data:
|
||||
data = {}
|
||||
return data
|
||||
elif ext == '.json':
|
||||
with open(file, mode='r', encoding='utf-8') as f:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user