From b4949eec5982643502bb9787cf5e2872a78807c1 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 21 May 2020 21:56:46 +0300 Subject: [PATCH] Add missing crypto != nil checks --- main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 13cb13e..ec63b35 100644 --- a/main.go +++ b/main.go @@ -254,7 +254,9 @@ func (bridge *Bridge) Start() { bridge.Log.Debugln("Starting event processor") go bridge.EventProcessor.Start() go bridge.UpdateBotProfile() - go bridge.Crypto.Start() + if bridge.Crypto != nil { + go bridge.Crypto.Start() + } go bridge.StartUsers() } @@ -319,7 +321,9 @@ func (bridge *Bridge) StartUsers() { } func (bridge *Bridge) Stop() { - bridge.Crypto.Stop() + if bridge.Crypto != nil { + bridge.Crypto.Stop() + } bridge.AS.Stop() bridge.EventProcessor.Stop() for _, user := range bridge.usersByJID {