diff options
author | Wim <wim@42.be> | 2019-02-26 18:03:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-26 18:03:50 +0100 |
commit | 7f1d86b338ff4fd700ab3ec4a62fd1eb96be19c8 (patch) | |
tree | 1b65f643c8864555814568f56551ba70ee04d58c /gateway/gateway.go | |
parent | d8816280f0e87b617d5ae795b9f031fd721c9148 (diff) | |
download | matterbridge-msglm-7f1d86b338ff4fd700ab3ec4a62fd1eb96be19c8.tar.gz matterbridge-msglm-7f1d86b338ff4fd700ab3ec4a62fd1eb96be19c8.tar.bz2 matterbridge-msglm-7f1d86b338ff4fd700ab3ec4a62fd1eb96be19c8.zip |
Fail gracefully on incorrect human input. Fixes #739 (#740)
Diffstat (limited to 'gateway/gateway.go')
-rw-r--r-- | gateway/gateway.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gateway/gateway.go b/gateway/gateway.go index cb7d94c1..be45086b 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -92,6 +92,9 @@ func (gw *Gateway) AddBridge(cfg *config.Bridge) error { Bridge: br, } // add the actual bridger for this protocol to this bridge using the bridgeMap + if _, ok := gw.Router.BridgeMap[br.Protocol]; !ok { + gw.logger.Fatalf("Incorrect protocol %s specified in gateway configuration %s, exiting.", br.Protocol, cfg.Account) + } br.Bridger = gw.Router.BridgeMap[br.Protocol](brconfig) } gw.mapChannelsToBridge(br) |