diff --git a/strange_eons_to_arkhamdb.js b/strange_eons_to_arkhamdb.js index 4d7ccdf..b6abb89 100644 --- a/strange_eons_to_arkhamdb.js +++ b/strange_eons_to_arkhamdb.js @@ -101,7 +101,6 @@ function build_card(component) { var card_data = { code: String(code), deck_limit: 2, // TODO: could be derived? - faction_code: String(component.settings.get('CardClass')).toLowerCase(), flavor: substitute_tags(String(component.settings.get('Flavor'))), illustrator: String(component.settings.get('Artist')), is_unique: component.settings.getBoolean('Unique'), @@ -165,9 +164,13 @@ function build_card(component) { card_data.subname = String(subtitle); } - var faction2 = component.settings.get('CardClass2'); - if (faction2 && faction2 != 'None') { - card_data.faction2_code = String(faction2).toLowerCase(); + var faction = component.settings.get('CardClass'); + if (faction) { + card_data.faction_code = String(faction).toLowerCase(); + var faction2 = component.settings.get('CardClass2'); + if (faction2 && faction2 != 'None') { + card_data.faction2_code = String(faction2).toLowerCase(); + } } if (card_types[component.getFrontTemplateKey()] == 'enemy') {