Skip to content

Commit

Permalink
Fix assumptions about actor data model that only hold for dnd5e 4.0+.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunkLightTuna committed Nov 9, 2024
1 parent 792ae6c commit 6ebe811
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/sync.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ function export_item(item) {
}

if (item.type === 'weapon') {
out.attack_modes = item.system.attackModes
.filter(a => 'value' in a)
.map(a => a.value)
out.attack_modes =
item.system.attackModes
?.filter(a => 'value' in a)
.map(a => a.value) ?? []
}

return out
Expand Down

0 comments on commit 6ebe811

Please sign in to comment.