Enhance category validation in getCategoryVariables to handle unconfigured client categories
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user