From: Steinar H. Gunderson Date: Thu, 21 Nov 2013 22:18:18 +0000 (+0100) Subject: Fix a crash that happens if we were looking at a PV line while new information came in. X-Git-Url: https://git.sesse.net/?p=remoteglot;a=commitdiff_plain;h=d757645e7300de9d75fd5d428aedacfeb426dc73 Fix a crash that happens if we were looking at a PV line while new information came in. --- diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index d259e27..8bb49d2 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -33,8 +33,12 @@ var request_update = function(board) { var clear_arrows = function() { for (var i = 0; i < arrows.length; ++i) { - jsPlumb.detach(arrows[i].connection1); - jsPlumb.detach(arrows[i].connection2); + if (arrows[i].connection1) { + jsPlumb.detach(arrows[i].connection1); + } + if (arrows[i].connection2) { + jsPlumb.detach(arrows[i].connection2); + } } arrows = [];