Skip to content

Commit 1034032

Browse files
committed
fix bug preventing result rows from being opened if there were no support_graphs
1 parent 1416c7d commit 1034032

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/pages/answer/useAnswerStore.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,13 @@ export default function useAnswerStore() {
121121
const edgesJSON = {};
122122
row.analyses.forEach((analysis) => {
123123
const edge_bindings = Object.values(analysis.edge_bindings).flat();
124-
const support_graph_edge_bindings = analysis.support_graphs.reduce((acc, support_graph_id) => (
125-
[...acc, ...message.auxiliary_graphs[support_graph_id].edges.map((e) => ({ id: e }))]
126-
), []);
124+
125+
const support_graph_edge_bindings = [];
126+
if (Array.isArray(analysis.support_graphs)) {
127+
analysis.support_graphs.forEach((supportGraphId) => {
128+
support_graph_edge_bindings.push(...message.auxiliary_graphs[supportGraphId].edges.map((e) => ({ id: e })));
129+
});
130+
}
127131

128132
[...edge_bindings, ...support_graph_edge_bindings].forEach((binding) => {
129133
const kgEdge = message.knowledge_graph.edges[binding.id];

0 commit comments

Comments
 (0)