cjbassi / ytop

A TUI system monitor written in Rust
MIT License
2.16k stars 84 forks source link

Fix crash if, for any reason, there are no processes to list #102

Open CosmicHorrorDev opened 4 years ago

CosmicHorrorDev commented 4 years ago

In #99 there was an issue where self.procs was occasionally empty causing the program to crash when trying to index for the selected process. This is likely due to some issue in psutil since the process list is provided by the psutil::process::ProcessCollector and shouldn't ever reasonably be empty. This also sets up the program better for if process filtering is established since a filter could easily yield no processes and would still have to display without crashing.