Enhance category validation in getCategoryVariables to handle unconfigured client categories

This commit is contained in:
jhartworks
2026-09-09 11:48:21 +02:00
parent 2d337c6308
commit d36c1a8219
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -271,7 +271,9 @@ class MonitoringClient extends IPSModule {
*/ */
private function getCategoryVariables($categoryId) { private function getCategoryVariables($categoryId) {
$variables = array(); $variables = array();
if (!IPS_CategoryExists($categoryId)) { // Unconfigured client categories use -1. IPS_CategoryExists() rejects
// negative IDs before it can return false.
if ($categoryId < 1 || !IPS_CategoryExists($categoryId)) {
return $variables; return $variables;
} }
+1 -1
View File
@@ -8,6 +8,6 @@
"date": 1491343200 "date": 1491343200
}, },
"version": "3.0", "version": "3.0",
"build": 1, "build": 2,
"date": 0 "date": 0
} }