Skip to content

Commit d5ed8e5

Browse files
committed
fix: Fix possible perl warning during network inventory
1 parent 4ce78bc commit d5ed8e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/GLPI/Agent/Tools/Hardware.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ sub _setGenericProperties {
626626
my $value = $results->{$suffix};
627627
next unless $value;
628628
# value must match IFNUMBER
629-
my $portindex = first { $ports->{$_}->{IFNUMBER} eq $value } keys(%{$ports});
629+
my $portindex = first { defined($ports->{$_}->{IFNUMBER}) && $ports->{$_}->{IFNUMBER} eq $value } keys(%{$ports});
630630
# safety checks
631631
unless ($portindex) {
632632
$logger->debug(

0 commit comments

Comments
 (0)