diff --git a/LibreNMS/Component.php b/LibreNMS/Component.php index bc6eb82ce6..52651e6965 100644 --- a/LibreNMS/Component.php +++ b/LibreNMS/Component.php @@ -159,10 +159,10 @@ class Component } // Sort each component array so the attributes are in order. - if (!empty($RESULT[$RESULT[$COMPONENT['device_id']][$COMPONENT['id']]])) { + if (is_array($RESULT[$RESULT[$COMPONENT['device_id']][$COMPONENT['id']]])) { ksort($RESULT[$RESULT[$COMPONENT['device_id']][$COMPONENT['id']]]); } - if (!empty($RESULT[$RESULT[$COMPONENT['device_id']]])) { + if (is_array($RESULT[$RESULT[$COMPONENT['device_id']]])) { ksort($RESULT[$RESULT[$COMPONENT['device_id']]]); } }