only remove links if they are in the layer

This commit is contained in:
Jon Atkins 2013-10-13 19:40:54 +01:00
parent 33bdc2c590
commit e7309000e0

View File

@ -192,7 +192,9 @@ window.Render.prototype.deletePortalEntity = function(guid) {
window.Render.prototype.deleteLinkEntity = function(guid) { window.Render.prototype.deleteLinkEntity = function(guid) {
if (guid in window.links) { if (guid in window.links) {
var l = window.links[guid]; 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]; delete window.links[guid];
} }
} }