Skip to content

Commit

Permalink
catch exception on unknown channels (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbyquaker committed Oct 8, 2018
1 parent 826bf03 commit 21433c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nodes/redmatic-webapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ module.exports = function (RED) {

const roomItems = {};
Object.keys(this.ccu.channelRooms).forEach(channel => {
if (this.ccu.channelRooms[channel]) {
if (this.ccu.channelRooms[channel] && channels[channel]) {
this.ccu.channelRooms[channel].forEach(room => {
roomItems[room] = roomItems[room] || [];
roomItems[room].push({
Expand All @@ -95,7 +95,7 @@ module.exports = function (RED) {


Object.keys(this.ccu.channelFunctions).forEach(channel => {
if (this.ccu.channelFunctions[channel]) {
if (this.ccu.channelFunctions[channel] && channels[channel]) {
this.ccu.channelFunctions[channel].forEach(func => {
functionItems[func] = functionItems[func] || [];
functionItems[func].push({
Expand Down

0 comments on commit 21433c9

Please sign in to comment.