Skip to content

Commit

Permalink
🐛 Also respect names actually be a valid array
Browse files Browse the repository at this point in the history
  • Loading branch information
segersniels committed Nov 24, 2023
1 parent b8dfe40 commit b294686
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utils/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ pub fn get_containers(container_type: Type) -> Result<Vec<String>, String> {
match result {
Ok(response) => {
for container in response.as_array().unwrap() {
if container["Names"].is_array()
&& container["Names"].as_array().unwrap().is_empty()
{
continue;
}

let id = &container["Id"].as_str().unwrap()[..12];
let name = &container["Names"][0]
.as_str()
Expand Down

0 comments on commit b294686

Please sign in to comment.