From 4688524e4564b4f55870ce7a44a7a5c7d90c21ce Mon Sep 17 00:00:00 2001 From: Roman Mazur Date: Tue, 23 Jul 2019 17:27:55 +0300 Subject: [PATCH] Filter both null and omitted values The docker daemon can sometimes return null for various fields, or omit the field altogether. The best thing to do with using the docker api is to always use == null to cover both instances. Change-type: patch Signed-off-by: Roman Mazur --- src/local-mode.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/local-mode.ts b/src/local-mode.ts index f4e47308..c4d58df7 100644 --- a/src/local-mode.ts +++ b/src/local-mode.ts @@ -155,8 +155,8 @@ export class LocalModeManager { return new EngineSnapshot( [inspectInfo.Id], [inspectInfo.Image], - inspectInfo.Mounts.filter(m => m.Name !== undefined).map(m => m.Name!), - _.values(inspectInfo.NetworkSettings.Networks).map(ns => ns.NetworkID), + inspectInfo.Mounts.filter(m => m.Name != null).map(m => m.Name!), + _.map(inspectInfo.NetworkSettings.Networks, n => n.NetworkID), ); }