diff --git a/pd/nw/pdgui.js b/pd/nw/pdgui.js index d88c0d58bee961d13b62debd1e8e0649db1f49b9..96f3db4502d0c301e421e7378c08cfbec76543df 100644 --- a/pd/nw/pdgui.js +++ b/pd/nw/pdgui.js @@ -2515,13 +2515,18 @@ function gui_scalar_draw_select_rect(cid, tag, state, x1, y1, x2, y2, basex, bas // for selected borders because somehow calling properties on a graph // triggers this function. I have no idea why it does that. var g = get_gobj(cid, tag), + b; + // somehow the scalar can unvis before calling this, so we check for + // its existence here... + if (g) { b = g.querySelector(".border"); - configure_item(b, { - x: (x1 - basex) + 0.5, - y: (y1 - basey) + 0.5, - width: x2 - x1, - height: y2 - y1, - }); + configure_item(b, { + x: (x1 - basex) + 0.5, + y: (y1 - basey) + 0.5, + width: x2 - x1, + height: y2 - y1 + }); + } } function gui_create_scalar_group(cid, tag, parent_tag, attr_array) {