From d4c7579c101d693827da2f3fad533ad725f97ba0 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sat, 2 Mar 2019 14:47:49 +0000 Subject: [PATCH] #522 TypeAhead.pm can reference empty data (inphobia) --- lib/App/Netdisco/Web/TypeAhead.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/App/Netdisco/Web/TypeAhead.pm b/lib/App/Netdisco/Web/TypeAhead.pm index 3994302e..40c7da62 100644 --- a/lib/App/Netdisco/Web/TypeAhead.pm +++ b/lib/App/Netdisco/Web/TypeAhead.pm @@ -49,7 +49,7 @@ ajax '/ajax/data/port/typeahead' => require_login sub { if $port; my $results = [ - map {{ label => (sprintf "%s (%s)", $_->port, $_->name), value => $_->port }} + map {{ label => (sprintf "%s (%s)", $_->port, ($_->name || '')), value => $_->port }} sort { &App::Netdisco::Util::Web::sort_port($a->port, $b->port) } $set->all ];