From 4a6fd4f015397c92804a6aeb8c2d9e4fde64e575 Mon Sep 17 00:00:00 2001 From: Skylar Sadlier Date: Mon, 30 Aug 2021 11:53:50 -0600 Subject: [PATCH] Closes #12 - Fixed: Client would crash if invalid login was passed and e2ee was enabled --- src/matrix-server-config.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/matrix-server-config.js b/src/matrix-server-config.js index ef1a7c1..8726ef6 100644 --- a/src/matrix-server-config.js +++ b/src/matrix-server-config.js @@ -136,11 +136,13 @@ module.exports = function(RED) { async function run() { if(node.e2ee){ - await node.matrixClient.initCrypto(); + node.matrixClient.initCrypto() + .catch((error) => node.error(error)); node.matrixClient.setGlobalErrorOnUnknownDevices(false); - } else { } - await node.matrixClient.startClient({ initialSyncLimit: 8 }); + + node.matrixClient.startClient({ initialSyncLimit: 8 }) + .catch((error) => node.error(error)); } node.log("Connecting to Matrix server...");