Skip to content

Commit

Permalink
menu: fix using undefined values
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Jan 18, 2024
1 parent 19ac8c2 commit 987e490
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Thruk/Utils/Menu.pm
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ sub _get_section_by_name {
my($name, $create) = @_;

for my $section (@{$Thruk::Utils::Menu::navigation}) {
return $section if $section->{'name'} eq $name;
return $section if ($section->{'name'} && $section->{'name'} eq $name);
}

if($create) {
Expand Down Expand Up @@ -550,9 +550,9 @@ returns a link by name
sub _get_sublink_by_name {
my $section = shift;
my $name = shift;
next unless defined $section->{'links'};
return unless ($section && defined $section->{'links'} && $name);
for my $sublink (@{$section->{'links'}}) {
if($sublink->{'name'} eq $name) {
if(($sublink->{'name'}//'') eq $name) {
return($sublink);
}
}
Expand Down

0 comments on commit 987e490

Please sign in to comment.