remind: fix segfautl due to broker not initialized yet

This commit is contained in:
Hamcha 2017-05-31 19:03:48 +02:00
parent def40e8bd7
commit 377aa68cb6

View file

@ -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()