From 5904c352d1027a5c70656f463bc86885f26fdcbb Mon Sep 17 00:00:00 2001 From: Petter Ericson Date: Wed, 17 Mar 2021 16:52:37 +0100 Subject: [PATCH] Not drawing metarelation with missing relations --- js/draw.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/draw.js b/js/draw.js index 76cd3a31..81428192 100644 --- a/js/draw.js +++ b/js/draw.js @@ -166,6 +166,11 @@ function draw_metarelation_arg(draw_context, mei_graph, g_elem) { var type = relation_type(g_elem); var targets = relation_allnodes_arg(mei_graph, g_elem).map( (e) => svg_find_from_mei_elem(svg_elem, id_prefix, e)); + if(targets.indexOf(null) != -1){ + console.log("Missing relation, not drawing metarelation"); + return []; + } + var coords = targets.map(get_metarelation_target); var x = average(coords.map((e) => e[0])); // Above