fix(DockerContainer): Fix getContainerById to return undefined for non-existent containers

This commit is contained in:
2025-11-24 16:03:04 +00:00
parent 2ecd4e9d7c
commit 35e8eff092
7 changed files with 97 additions and 6 deletions

View File

@@ -164,8 +164,9 @@ export class DockerHost {
/**
* Gets a container by ID
* Returns undefined if container does not exist
*/
public async getContainerById(containerId: string) {
public async getContainerById(containerId: string): Promise<DockerContainer | undefined> {
return await DockerContainer._fromId(this, containerId);
}