Skip to content

Commit

Permalink
fix: accidentally broke everything lol whoops
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Feb 2, 2023
1 parent 759e235 commit 319e141
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/view/statblock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,17 @@ export default class StatBlockRenderer extends MarkdownRenderChild {

for (const block of this.getBlocksToTransform(this.layout.blocks)) {
for (const property of block.properties) {
let transformedProperty;
if (!(property in built)) continue;
let transformedProperty = built[property];
if (block.type == "traits") {
transformedProperty = transformTraits(
(built[property] as Trait[]) ?? []
);
} else if (block.type == "saves") {
} else if (
block.type == "saves" &&
!Array.isArray(built[property]) &&
typeof built[property] == "object"
) {
transformedProperty = Object.entries(
built[property] ?? {}
).map(([key, value]) => {
Expand Down

0 comments on commit 319e141

Please sign in to comment.