fix: out of bounds error, closes [#8]

use .is_some() and if let Some() to make sure that container indexes are still valid, without can cause out of bounds issue due to docker update frequencies
This commit is contained in:
Jack Wills
2022-05-30 02:13:17 +00:00
parent 9c0e98a1d7
commit 63b7de5345
3 changed files with 36 additions and 30 deletions
+1 -1
View File
@@ -160,7 +160,7 @@ impl DockerControls {
match state {
State::Dead | State::Exited => vec![Self::Start, Self::Restart],
State::Paused => vec![Self::Unpause, Self::Stop],
State::Restarting => vec![Self::Stop],
State::Restarting => vec![Self::Stop],
State::Running => vec![Self::Pause, Self::Restart, Self::Stop],
_ => vec![],
}