From 2879c33c8fec103fe15c18216bf718bec65f4246 Mon Sep 17 00:00:00 2001 From: Sean Chittenden Date: Fri, 10 Jun 2016 23:43:54 -0400 Subject: [PATCH] Perform a nil-check for Executor's consulServices. Executors can `Shutdown()` before calling `SyncServices()`. --- client/driver/executor/executor.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/driver/executor/executor.go b/client/driver/executor/executor.go index f7d971be9..063db646e 100644 --- a/client/driver/executor/executor.go +++ b/client/driver/executor/executor.go @@ -425,7 +425,9 @@ func (e *UniversalExecutor) Exit() error { e.lre.Close() e.lro.Close() - e.consulSyncer.Shutdown() + if e.consulSyncer != nil { + e.consulSyncer.Shutdown() + } // If the executor did not launch a process, return. if e.command == nil {