From bea2c4c379710fd99e371d6856d08ec98dca4579 Mon Sep 17 00:00:00 2001 From: Jonathan Hall Date: Wed, 31 Dec 2014 18:20:30 +0100 Subject: [PATCH] Silence some warnings when $p0f->{genre} is undefined --- plugins/ident/p0f | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/ident/p0f b/plugins/ident/p0f index 59fe7c0..6299d65 100644 --- a/plugins/ident/p0f +++ b/plugins/ident/p0f @@ -216,14 +216,14 @@ sub rcpt_handler { sub check_genre { my ( $self, $rcpt ) = @_; - my $p0f = $self->connection->notes('p0f') or return 0; + my $genre = ( $self->connection->notes('p0f') || {} )->{genre} or return 0; return 0 if $self->exclude_connection(); return 0 if $self->exclude_recipient($rcpt); for my $phrase ( @{ $self->{os_block} || [] } ) { - return 1 if $p0f->{genre} eq $phrase; + return 1 if $genre eq $phrase; } for my $re ( @{ $self->{os_block_re} || [] } ) { - return 1 if $p0f->{genre} =~ $re; + return 1 if $genre =~ $re; } return 0; }