Skip to content

Commit

Permalink
fix: allow for codices which don't contain the svg content
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Bryce committed Nov 11, 2023
1 parent 5f520db commit 7bca2a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/trial.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ export function codexTrialDetails(codex, options = {}) {
codex.getIndexedItem(CODEX_FURNITURE_INDEX, options)
);

const svg = JSON.parse(codex.getIndexedItem(CODEX_SVG_INDEX, options));
let svg;
if (codex.hasIndexedItem(CODEX_SVG_INDEX))
svg = JSON.parse(codex.getIndexedItem(CODEX_SVG_INDEX, options));

const topology = LogicalTopology.fromMapJSON(map);
topology.placeFurniture(new Furniture(furnishings));
Expand Down

0 comments on commit 7bca2a5

Please sign in to comment.