From 148b2b9d024b61cb59eeb1bae682f2df85df9719 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Wed, 9 Sep 2015 12:58:57 +0200 Subject: [PATCH] Fix crash when relaying or global discovery is disabled (fixes #2246) --- lib/relay/relay.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/relay/relay.go b/lib/relay/relay.go index 044d59d2..e97bb110 100644 --- a/lib/relay/relay.go +++ b/lib/relay/relay.go @@ -192,6 +192,12 @@ func (s *Svc) CommitConfiguration(from, to config.Configuration) bool { } func (s *Svc) ClientStatus() map[string]bool { + if s == nil { + // A nil client does not have a status, really. Yet we may be called + // this way, for raisins... + return nil + } + s.mut.RLock() status := make(map[string]bool, len(s.clients)) for uri, client := range s.clients {