From a34a39481096be8259b4ced683829d65e5acdb56 Mon Sep 17 00:00:00 2001 From: Nick Gauthier Date: Mon, 16 Nov 2015 15:54:16 +0100 Subject: [PATCH] skip printing swarm info when host options swarm info is nil Fixes #2252 #2280 Signed-off-by: Nick Gauthier --- commands/ls.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/ls.go b/commands/ls.go index a7a5cca924..884515a3c7 100644 --- a/commands/ls.go +++ b/commands/ls.go @@ -91,7 +91,7 @@ func cmdLs(c CommandLine) error { swarmInfo := "" - if item.SwarmOptions.Discovery != "" { + if item.SwarmOptions != nil && item.SwarmOptions.Discovery != "" { swarmInfo = swarmMasters[item.SwarmOptions.Discovery] if item.SwarmOptions.Master { swarmInfo = fmt.Sprintf("%s (master)", swarmInfo)