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 <roman@balena.io>
This commit is contained in:
Roman Mazur 2019-07-23 17:27:55 +03:00
parent 4b56022d93
commit 4688524e45
No known key found for this signature in database
GPG Key ID: 9459886EFE6EE2F6

View File

@ -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),
);
}