Skip to content

Commit 6f7a096

Browse files
committed
Check if server name is not null in the Glances browser - Related to nicolargo#2861
1 parent 18bade9 commit 6f7a096

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

glances/outputs/glances_curses_browser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ def __display_server_list(self, stats, x, y, screen_x, screen_y):
348348
for c in column_def:
349349
if xc < screen_x and y < screen_y:
350350
# Display server stats
351-
value = format(server_stat.get(c[0], '?'))
352-
if c[0] == 'name' and 'alias' in server_stat:
351+
value = server_stat.get(c[0], '?')
352+
if c[0] == 'name' and 'alias' in server_stat and server_stat['alias'] is not None:
353353
value = server_stat['alias']
354354
decoration = self.colors_list.get(
355355
server_stat[c[0] + '_decoration'].replace('_LOG', '')
@@ -359,7 +359,7 @@ def __display_server_list(self, stats, x, y, screen_x, screen_y):
359359
)
360360
if c[0] == 'status':
361361
decoration = self.colors_list[server_stat['status']]
362-
self.term_window.addnstr(y, xc, value, c[2], decoration)
362+
self.term_window.addnstr(y, xc, format(value), c[2], decoration)
363363
xc += c[2] + self.space_between_column
364364
cpt += 1
365365
# Next line, next server...

0 commit comments

Comments
 (0)