summaryrefslogtreecommitdiffstats
path: root/bridge
diff options
context:
space:
mode:
authorWim <wim@42.be>2020-02-01 15:23:50 +0100
committerGitHub <noreply@github.com>2020-02-01 15:23:50 +0100
commit748655587527875ea360822255a60a892b8c4953 (patch)
tree3aa58101a57547e2c9c0d48fdc3f21633bad7446 /bridge
parentfc30b1bacc4ceb6dd978c5838609371fa6abd801 (diff)
downloadmatterbridge-msglm-748655587527875ea360822255a60a892b8c4953.tar.gz
matterbridge-msglm-748655587527875ea360822255a60a892b8c4953.tar.bz2
matterbridge-msglm-748655587527875ea360822255a60a892b8c4953.zip
Fail with message instead of panic. #988 (#991)
Diffstat (limited to 'bridge')
-rw-r--r--bridge/bridge.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/bridge/bridge.go b/bridge/bridge.go
index fdc1ec8b..5612e35d 100644
--- a/bridge/bridge.go
+++ b/bridge/bridge.go
@@ -1,6 +1,7 @@
package bridge
import (
+ "log"
"strings"
"sync"
@@ -41,6 +42,10 @@ type Factory func(*Config) Bridger
func New(bridge *config.Bridge) *Bridge {
accInfo := strings.Split(bridge.Account, ".")
+ if len(accInfo) != 2 {
+ log.Fatalf("config failure, account incorrect: %s", bridge.Account)
+ }
+
protocol := accInfo[0]
name := accInfo[1]