Don't crash when there are no ports
This commit is contained in:
parent
6cc17e7fca
commit
4c3c251181
1 changed files with 1 additions and 1 deletions
|
|
@ -340,7 +340,7 @@ impl UI {
|
|||
}
|
||||
Some(UIEvent::Ports(mut p)) => {
|
||||
p.sort_by(|a, b| a.port.partial_cmp(&b.port).unwrap());
|
||||
if self.selection >= p.len() {
|
||||
if self.selection >= p.len() && p.len() > 0 {
|
||||
self.selection = p.len() - 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue