From 7f1d86b338ff4fd700ab3ec4a62fd1eb96be19c8 Mon Sep 17 00:00:00 2001 From: Wim Date: Tue, 26 Feb 2019 18:03:50 +0100 Subject: [PATCH] Fail gracefully on incorrect human input. Fixes #739 (#740) --- gateway/gateway.go | 3 +++ 1 file changed, 3 insertions(+) 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)