Fix handling of yaml files with empty entries
Fixes a bug if data.yml contains empty nodes under globals, functions,
or classes.
@@ -396,20 +396,23 @@ def load_data():
with open(api.data_file_path, "r") as fd:
data = yaml.safe_load(fd)
+ if data.get("globals"):
for ea, name in data["globals"].items():
if not isinstance(ea, (int, long)):
print('Warning: {0} has an invalid address {1}'.format(name, ea))
continue
api.set_addr_name(ea, name)
+ if data.get("functions"):
for ea, name in data["functions"].items():
if not isinstance(ea, (int, long)):
print('Warning: {0} has an invalid address {1}'.format(name, ea))
continue
api.set_addr_name(ea, name)
- factory = FfxivClassFactory()
+ if data.get("classes"):
+ factory = FfxivClassFactory()
for class_name, class_data in data["classes"].items():
if not class_data:
class_data = {}
