From 72579c9a40e640ecb79517e97857ed5b1bda270b Mon Sep 17 00:00:00 2001
From: Will Hunt <will@half-shot.uk>
Date: Mon, 30 Apr 2018 09:05:51 +0100
Subject: [PATCH] Make sure MXEvtProcessor has bridge defined

---
 src/bot.ts | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/bot.ts b/src/bot.ts
index a4bbeb4..0a69e4a 100644
--- a/src/bot.ts
+++ b/src/bot.ts
@@ -48,14 +48,14 @@ export class DiscordBot {
     this.msgProcessor = new MessageProcessor(
       new MessageProcessorOpts(this.config.bridge.domain, this),
     );
-    this.mxEventProcessor = new MatrixEventProcessor(
-        new MatrixEventProcessorOpts(this.config, this.bridge),
-    );
     this.presenceHandler = new PresenceHandler(this);
   }
 
   public setBridge(bridge: Bridge) {
     this.bridge = bridge;
+    this.mxEventProcessor = new MatrixEventProcessor(
+        new MatrixEventProcessorOpts(this.config, bridge),
+    );
   }
 
   get ClientFactory(): DiscordClientFactory {
-- 
GitLab