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) {
|
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
@@ -8,6 +8,6 @@
|
|||||||
"date": 1491343200
|
"date": 1491343200
|
||||||
},
|
},
|
||||||
"version": "3.0",
|
"version": "3.0",
|
||||||
"build": 1,
|
"build": 2,
|
||||||
"date": 0
|
"date": 0
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user