return;
}
- # Convert and validate the given address.
- my $bin_address = &Guardian::Base::IPOrNet2Int($address);
-
- # Abort if the given address could not be converted because it is not valid.
- unless ($bin_address) {
- $logger->Log("err", "Invalid IP address: $address");
- return;
- }
+ # Check if the given event contains an address.
+ if ($address) {
+ # Convert and validate the given address.
+ my $bin_address = &Guardian::Base::IPOrNet2Int($address);
+
+ # Abort if the given address could not be converted because it is not valid.
+ unless ($bin_address) {
+ $logger->Log("err", "Invalid IP address: $address");
+ return;
+ }
- # Check if address should be ignored.
- if(&_IsOnIgnoreList($bin_address)) {
- # Log message.
- $logger->Log("info", "Ignoring event for $address, because it is part of the ignore list.");
- return;
+ # Check if address should be ignored.
+ if(&_IsOnIgnoreList($bin_address)) {
+ # Log message.
+ $logger->Log("info", "Ignoring event for $address, because it is part of the ignore list.");
+ return;
+ }
}
# Call required handler.