From e7309000e008bba9cc29db74100d86a32a7deed7 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sun, 13 Oct 2013 19:40:54 +0100 Subject: [PATCH] only remove links if they are in the layer --- code/map_data_render.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/map_data_render.js b/code/map_data_render.js index ec06f4e0..85b89b9c 100644 --- a/code/map_data_render.js +++ b/code/map_data_render.js @@ -192,7 +192,9 @@ window.Render.prototype.deletePortalEntity = function(guid) { window.Render.prototype.deleteLinkEntity = function(guid) { if (guid in window.links) { var l = window.links[guid]; - linksFactionLayers[l.options.team].removeLayer(l); + if (linksFactionLayers[l.options.team].hasLayer(l)) { + linksFactionLayers[l.options.team].removeLayer(l); + } delete window.links[guid]; } }