]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
ids-functions.pl: Improve logic to get the cached rulesfile of a provider
authorStefan Schantl <stefan.schantl@ipfire.org>
Thu, 21 Mar 2024 20:51:14 +0000 (21:51 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 22 Mar 2024 15:18:41 +0000 (15:18 +0000)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/cfgroot/ids-functions.pl

index d97431b4a3dd82c45f93b007c0e5b24784e31296..c29a5151f9f443ff31500bf3d80cbdaee6e0978d 100644 (file)
@@ -1027,11 +1027,14 @@ sub _store_error_message ($) {
 sub _get_dl_rulesfile($) {
        my ($provider) = @_;
 
-       # Check if the requested provider is known.
-       if ($IDS::Ruleset::Providers{$provider}) {
-               # Gather the download type for the given provider.
-               my $dl_type = $IDS::Ruleset::Providers{$provider}{'dl_type'};
+       # Abort if the requested provider is not known.
+       return unless($IDS::Ruleset::Providers{$provider});
 
+       # Try to gather the download type for the given provider.
+       my $dl_type = $IDS::Ruleset::Providers{$provider}{'dl_type'};
+
+       # Check if a download type could be grabbed.
+       if ($dl_type) {
                # Obtain the file suffix for the download file type.
                my $suffix = $dl_type_to_suffix{$dl_type};