diff --git a/mhdata/build/sql.py b/mhdata/build/sql.py index d92c112..f467514 100644 --- a/mhdata/build/sql.py +++ b/mhdata/build/sql.py @@ -784,7 +784,7 @@ def build_charms(session : sqlalchemy.orm.Session, mhdata): )) # Add Charm Recipe - if entry['craft']: + if entry.get('craft'): for item_en, quantity in datafn.iter_recipe(entry['craft'][0]): item_id = item_map.id_of('en', item_en) ensure(item_id, f"Charm {entry.name('en')} refers to " + diff --git a/mhdata/load/validate.py b/mhdata/load/validate.py index 4d715e5..1e8c078 100644 --- a/mhdata/load/validate.py +++ b/mhdata/load/validate.py @@ -331,7 +331,7 @@ def validate_charms(mhdata): errors.append(f"Skill {skill_name} in charms does not exist") # Currently charms only link to a single recipe, but the schema supports more than one - if len(entry['craft']) > 1: + if len(entry.get('craft', [])) > 1: errors.append(f"Charm {entry['name_en']} has more than one recipe, which is not supported")