From 7a481282c0906b3b3c24b5a83e7a671768938615 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sun, 8 Apr 2018 13:11:02 +0100 Subject: [PATCH] allow empty description --- lib/App/Netdisco/Web/Plugin/Device/Neighbors.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/App/Netdisco/Web/Plugin/Device/Neighbors.pm b/lib/App/Netdisco/Web/Plugin/Device/Neighbors.pm index 9adde677..894be030 100644 --- a/lib/App/Netdisco/Web/Plugin/Device/Neighbors.pm +++ b/lib/App/Netdisco/Web/Plugin/Device/Neighbors.pm @@ -103,6 +103,8 @@ sub make_link_infostring { (my $right_name = lc($link->{right_dns} || $link->{right_name} || $link->{right_ip})) =~ s/$domain$//; if ($link->{aggports} == 1) { + $link->{left_descr}->[0] ||= 'no description'; + $link->{right_descr}->[0] ||= 'no description'; return sprintf '%s:%s (%s)
%s:%s (%s)', $left_name, $link->{left_port}->[0], $link->{left_descr}->[0], $right_name, $link->{right_port}->[0], $link->{right_descr}->[0];