Skip to content

Commit

Permalink
Fix #408
Browse files Browse the repository at this point in the history
  • Loading branch information
rbonghi committed Jan 9, 2024
1 parent 0e0ad70 commit 3524f90
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions jtop/gui/lib/process_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def __init__(self, stdscr, jetson):
self.type_reverse = True

def draw(self, pos_y, pos_x, width, height, key, mouse):
processes = self.jetson.processes
# Plot low bar background line
try:
self.stdscr.addstr(pos_y, 0, " " * width, NColors.igreen())
Expand All @@ -67,7 +66,11 @@ def draw(self, pos_y, pos_x, width, height, key, mouse):
except curses.error:
break
# Sort table for selected line
sorted_processes = sorted(processes, key=lambda x: x[self.line_sort], reverse=self.type_reverse)
try:
sorted_processes = self.jetson.processes
sorted_processes = sorted(sorted_processes, key=lambda x: x[self.line_sort], reverse=self.type_reverse)
except IndexError:
pass
# Draw all processes
# Instantiate the number of process variable to avoid an unbound local error if the process table is empty.
nprocess = 0
Expand Down

0 comments on commit 3524f90

Please sign in to comment.