]> git.ipfire.org Git - people/stevee/guardian.git/blobdiff - modules/Parser.pm
Only process any actions on events if the corresponding parser returns one.
[people/stevee/guardian.git] / modules / Parser.pm
index 9ec058693ee8866aa82ce0979a2eba2f2f5a5d93..13715e004dcd7fe5d8115e6d492c463b8fe32dc7 100644 (file)
@@ -30,16 +30,14 @@ sub Parser ($$) {
        # Call responsible message parser.
        my $action = $logfile_parsers{$parser}->(@message);
 
-       # If the parser successfully parsed the message, an action
-       # has been returned.
-       if ($action) {
+       # In case an action has been returned, return it too. 
+       if (defined($action)) {
                # Return which action should be performed.
                return "count $action";
        }
 
-       # If the parser was not able to parse the the given message
-       # in the right way, return Nothing.
-       return;
+       # Return undef, no action required.
+       return undef;
 }
 
 #