docker: container id cannot be null

This commit is contained in:
Girish Ramakrishnan
2025-08-26 11:07:59 +02:00
parent 54d3cd86b9
commit 4381809959

View File

@@ -489,12 +489,9 @@ async function restartContainer(containerId) {
}
async function stopContainer(containerId) {
assert(!containerId || typeof containerId === 'string');
assert.strictEqual(typeof containerId, 'string');
if (!containerId) {
debug('No previous container to stop');
return;
}
debug(`stopContainer: stopping container ${containerId}`);
const container = gConnection.getContainer(containerId);
@@ -510,9 +507,9 @@ async function stopContainer(containerId) {
}
async function deleteContainer(containerId) { // id can also be name
assert(!containerId || typeof containerId === 'string');
assert.strictEqual(typeof containerId, 'string');
if (containerId === null) return null;
debug(`deleteContainer: deleting ${containerId}`);
const container = gConnection.getContainer(containerId);