diff --git a/node/node.go b/node/node.go index ac9a31251fa921cf989855bb043c1547580aa56e..8311e1a166dc289e669fb35ab90d26e8c89397af 100644 --- a/node/node.go +++ b/node/node.go @@ -348,6 +348,13 @@ func (rc *RadioNode) updater(stop chan bool) { for { select { case <-rc.upch: + // We may have received an update before the + // masterelection had time to actually elect a + // master. In this case, skip. + if !rc.me.Valid() { + continue + } + icecastReloads.Incr() rc.Log.Printf("reloading icecast config") if err := rc.icecast.Update(rc.config, rc.me.IsMaster(), rc.getMasterAddr()); err != nil {