diff --git a/src/docker.js b/src/docker.js index 318cf0c2c..696280c9f 100644 --- a/src/docker.js +++ b/src/docker.js @@ -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);