index : btroops | |
Virtual board game-aid for BattleTroops, an infantry combat simulator wargame published by FASA in 1989. |
aboutsummaryrefslogtreecommitdiff |
diff options
author | Catalin Mititiuc <webdevcat@proton.me> | 2024-05-15 11:23:21 -0700 |
---|---|---|
committer | Catalin Mititiuc <webdevcat@proton.me> | 2024-05-15 11:23:21 -0700 |
commit | 7021b499339ae1e9bede4fe85895108c49b805a4 (patch) | |
tree | 2b6ab53d4cabb3166c3972451cd3a7aa86406ceb /src | |
parent | 26285e4be7159108e5dba9a79543fff2860e8a69 (diff) |
Don't blow up if weapon element missing from trooper counters
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/record_sheet.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/record_sheet.js b/src/modules/record_sheet.js index 4d8aada..78dbace 100644 --- a/src/modules/record_sheet.js +++ b/src/modules/record_sheet.js @@ -41,7 +41,7 @@ function createIcon(number) { function createRecord(unit) { const { dataset: { allegiance, number }} = unit, primaryWeapon = unit.querySelector('.primary-weapon'), - pw = primaryWeapon.getAttribute('href').replace('#', ''), + pw = primaryWeapon?.getAttribute('href').replace('#', '') || 'rifle', div = document.createElement('div', { is: 'soldier-record-block' }), spans = Array(5).fill('span').map(t => document.createElement(t)), [tn, pwt, pwd, pwrs, pwrl] = spans; |