After node update, we get a buffer

This commit is contained in:
Girish Ramakrishnan
2020-01-30 16:06:11 -08:00
parent 4818e9a8e4
commit 1ac38d4921

View File

@@ -108,9 +108,10 @@ function ping(callback) {
connection.ping(function (error, result) {
if (error) return callback(new BoxError(BoxError.DOCKER_ERROR, error));
if (result !== 'OK') return callback(new BoxError(BoxError.DOCKER_ERROR, 'Unable to ping the docker daemon'));
if (Buffer.isBuffer(result) && result.toString('utf8') === 'OK') return callback(null); // sometimes it returns buffer
if (result === 'OK') return callback(null);
callback(null);
callback(new BoxError(BoxError.DOCKER_ERROR, 'Unable to ping the docker daemon'));
});
}