Skip to content

Commit

Permalink
collector: extra check on close_snmp_session()
Browse files Browse the repository at this point in the history
To avoid:
 Can't call method "close" on an undefined value

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
  • Loading branch information
Jesper Dangaard Brouer committed Jun 1, 2011
1 parent a48af2b commit bfe3739
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion collector/lib/IPTV/Analyzer/snmptrap.pm
Expand Up @@ -68,7 +68,9 @@ sub open_snmp_session($$)

sub close_snmp_session()
{
$snmp_session->close();
if (defined $snmp_session) {
$snmp_session->close();
}
$snmp_session = undef;
}

Expand Down

0 comments on commit bfe3739

Please sign in to comment.