From fb05e73a0bc7868d64dc76743f15f9efa1e88332 Mon Sep 17 00:00:00 2001 From: James Hadfield Date: Wed, 23 Feb 2022 13:38:02 +1300 Subject: [PATCH] [bugfix] Allow datasets without mutations See https://github.com/nextstrain/auspice/issues/1474 for more context --- src/util/treeMiscHelpers.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/treeMiscHelpers.js b/src/util/treeMiscHelpers.js index dff02c07e..f4a28cdeb 100644 --- a/src/util/treeMiscHelpers.js +++ b/src/util/treeMiscHelpers.js @@ -239,6 +239,7 @@ export const categoriseSeqChanges = (seqChangesToRoot) => { */ export const getBranchMutations = (branchNode, observedMutations) => { const mutations = branchNode.branch_attrs && branchNode.branch_attrs.mutations; + if (typeof mutations !== "object") return {}; const seqChangesToRoot = branchNode.parent===branchNode ? {} : getSeqChanges(branchNode, mutations); const categorisedMutations = categoriseMutations(mutations, observedMutations, seqChangesToRoot); return categorisedMutations;