From bb7f35987505044af6b91a62c207a1a81e6b7f7f Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 11 Mar 2024 11:47:32 +0100 Subject: [PATCH] #13029 fix 500 agent view --- pandora_console/include/functions_agents.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 44c315f8c0..f7644e8919 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -4553,12 +4553,14 @@ function agents_get_starmap( var randomPoint = getRandomInteger(1, total_modules); let target = $(`#rect_${randomPoint}`); let class_name = target.attr('class'); - class_name = class_name.split('_')[0]; - setTimeout(function() { - target.removeClass(); - target.addClass(`${class_name}_${solid}`); - oneSquare(getRandomInteger(1, 10), getRandomInteger(100, 900)); - }, time); + if(target.length){ + class_name = class_name.split('_')[0]; + setTimeout(function() { + target.removeClass(); + target.addClass(`${class_name}_${solid}`); + oneSquare(getRandomInteger(1, 10), getRandomInteger(100, 900)); + }, time); + } } let cont = 0;