From f4f5fcdb6d983d4eb95e7b50b5a1940c44dfb9d3 Mon Sep 17 00:00:00 2001
From: Jarrod Johnson <jjohnson2@lenovo.com>
Date: Tue, 12 Mar 2024 09:36:40 -0400
Subject: [PATCH] Fix lldp when peername is null

Some neighbors result in a null name, handle that.
---
 confluent_server/confluent/networking/lldp.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/confluent_server/confluent/networking/lldp.py b/confluent_server/confluent/networking/lldp.py
index e1fd8d4e..e181d46f 100644
--- a/confluent_server/confluent/networking/lldp.py
+++ b/confluent_server/confluent/networking/lldp.py
@@ -381,9 +381,10 @@ def list_info(parms, requestedparameter):
                 break
         else:
             candidate = info[requestedparameter]
-            candidate = candidate.strip()
-            if candidate != '':
-                results.add(_api_sanitize_string(candidate))
+            if candidate:
+                candidate = candidate.strip()
+                if candidate != '':
+                    results.add(_api_sanitize_string(candidate))
     return [msg.ChildCollection(x + suffix) for x in util.natural_sort(results)]
 
 def _handle_neighbor_query(pathcomponents, configmanager):