From 73a124b299b9395d0adf636bb1d05eee9beb590c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Gonz=C3=A1lez?= Date: Thu, 9 Jun 2022 14:00:53 +0200 Subject: [PATCH] Fix possible custom_data with null strings --- pandora_console/operation/events/events.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index b72217fa2c..5fba6a4bfe 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -2315,7 +2315,7 @@ function process_datatables_item(item) { item.evento = evn; /* Group name */ - if (item.id_grupo == "0") { + if (typeof item.id_grupo === 'undefined' || item.id_grupo == "0") { item.id_grupo = ""; } else { item.id_grupo = item.group_name; @@ -2335,7 +2335,7 @@ function process_datatables_item(item) { } })(item.custom_data); - if (item_custom_data_obj !== false) { + if (item_custom_data_obj !== false && item_custom_data_obj !== null) { for (const [attr_name, val] of Object.entries(item_custom_data_obj)) { custom_data_str += attr_name + ' = ' + val + '
'; }