From d441f193f265019e22d791ccfd9914aaf95e3b10 Mon Sep 17 00:00:00 2001 From: Erick Hitter <services@ethitter.com> Date: Fri, 16 Dec 2016 20:20:15 -0800 Subject: [PATCH] Error for buttons without a configuration --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index a20f0d3..5f21fd4 100644 --- a/index.js +++ b/index.js @@ -34,6 +34,11 @@ client.on( 'newVerifiedButton', function( bdAddr ) { * BUTTON REACTIONS */ function listenToButton( bdAddr ) { + if ( "object" !== typeof config.buttons[bdAddr] ) { + console.error( 'No configuration for button ' + bdAddr ); + return; + } + var cc = new FlicConnectionChannel( bdAddr ); client.addConnectionChannel( cc ); -- GitLab