Skip to content

Commit

Permalink
fix: fixes crash when no statblock elements are created
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed May 10, 2023
1 parent 9d97107 commit b2156fb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/view/ui/ColumnContainer.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script lang="ts">
import type { Monster, Trait } from "types";
import Traits from "./Traits.svelte";
import Heading from "./Heading.svelte";
import PropertyLine from "./PropertyLine.svelte";
Expand All @@ -19,6 +17,7 @@
import Content from "./Content.svelte";
import SpellItem from "./SpellItem.svelte";
import type StatBlockPlugin from "src/main";
import type { Monster, Trait } from "index";
const dispatch = createEventDispatcher();
Expand Down Expand Up @@ -511,7 +510,7 @@
if (!targets.length) {
for (let item of statblock) {
const elements = getElementForStatblockItem(item);
targets.push(...elements);
if (elements?.length) targets.push(...elements);
}
}
Expand Down

0 comments on commit b2156fb

Please sign in to comment.