From 377aa68cb6df5c701c10f4ae7b7b660b47ccf997 Mon Sep 17 00:00:00 2001 From: Hamcha Date: Wed, 31 May 2017 19:03:48 +0200 Subject: [PATCH] remind: fix segfautl due to broker not initialized yet --- mods/remind.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mods/remind.go b/mods/remind.go index f333ea1..99c120f 100644 --- a/mods/remind.go +++ b/mods/remind.go @@ -108,6 +108,11 @@ func remind(broker *tg.Broker, update tg.APIMessage) { } func runreminder(id string) { + // In case this is called in the init, wait until the broker is available + for broker == nil { + // Wait + } + // Get reminder r := reminders[id] remaining := r.When - time.Now().Unix()