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) {
$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;
}