docker: container id cannot be null
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user