Pārlūkot izejas kodu

mejor checkeo de errores

Luciano Andrade 9 gadi atpakaļ
vecāks
revīzija
ce1d4a2c29
1 mainītis faili ar 3 papildinājumiem un 2 dzēšanām
  1. 3 2
      OSS_SNMP/MIBS/DocsIfCmts.php

+ 3 - 2
OSS_SNMP/MIBS/DocsIfCmts.php

@@ -305,7 +305,7 @@ accessDenied(7)   The CMTS has sent a Registration Aborted message   to the CM
     public function docsIfSigQSignalNoise(){
 	$rtr = array();
 	$data = $this->getSNMP()->realWalk(self::OID_docsIfSigQSignalNoise);
-	foreach($data as $oid => $val){
+	if($data) foreach($data as $oid => $val){
 		sscanf($val,"INTEGER: %f TenthdB", $readval);
 		$rtr[substr($oid,strlen(self::OID_docsIfSigQSignalNoise)+2)] = $readval;
 	}
@@ -316,7 +316,8 @@ accessDenied(7)   The CMTS has sent a Registration Aborted message   to the CM
 	$oid = self::OID_docsIfSigQMicroreflections;
 	$rtr = array();
 	if($trans){
-	foreach($this->getSNMP()->realWalk($oid) as $oid => $val){
+	$data = $this->getSNMP()->realWalk($oid);
+	if($data) foreach($data as $oid => $val){
 		sscanf($val,"INTEGER: %f -dBc", $readval);
 		$rtr[substr($oid,strlen(self::OID_docsIfSigQSignalNoise)+2)] = $readval;
 	}