diff options
author | nicolargo <nicolashennion@gmail.com> | 2024-07-06 08:30:02 +0200 |
---|---|---|
committer | nicolargo <nicolashennion@gmail.com> | 2024-07-06 08:30:02 +0200 |
commit | 6f7a09686c4ec3a90f1aa16897dbc981202aafe9 (patch) | |
tree | 3799cff99a0800e2f8547c5ce1d949158e0902ed | |
parent | 18bade9edf17f22e35b04362f14bbcb140c3075d (diff) |
Check if server name is not null in the Glances browser - Related to #2861issue2861
-rw-r--r-- | glances/outputs/glances_curses_browser.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/glances/outputs/glances_curses_browser.py b/glances/outputs/glances_curses_browser.py index 20d0972f..6893755f 100644 --- a/glances/outputs/glances_curses_browser.py +++ b/glances/outputs/glances_curses_browser.py @@ -348,8 +348,8 @@ class GlancesCursesBrowser(_GlancesCurses): for c in column_def: if xc < screen_x and y < screen_y: # Display server stats - value = format(server_stat.get(c[0], '?')) - if c[0] == 'name' and 'alias' in server_stat: + value = server_stat.get(c[0], '?') + if c[0] == 'name' and 'alias' in server_stat and server_stat['alias'] is not None: value = server_stat['alias'] decoration = self.colors_list.get( server_stat[c[0] + '_decoration'].replace('_LOG', '') @@ -359,7 +359,7 @@ class GlancesCursesBrowser(_GlancesCurses): ) if c[0] == 'status': decoration = self.colors_list[server_stat['status']] - self.term_window.addnstr(y, xc, value, c[2], decoration) + self.term_window.addnstr(y, xc, format(value), c[2], decoration) xc += c[2] + self.space_between_column cpt += 1 # Next line, next server... |