Skip to content

Commit

Permalink
Merge pull request #48 from farooqu/fix#47
Browse files Browse the repository at this point in the history
fix issue #47, startup crash
  • Loading branch information
maddox authored Dec 1, 2016
2 parents 90e88c0 + 45cc77a commit a851ff7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,14 @@ mqttClient.on('message', function (topic, message) {

if (currentActivityCommandMatches) {
var hubSlug = currentActivityCommandMatches[1]
activitySlug = harmonyHubStates[hubSlug].current_activity.slug
var messageComponents = message.toString().split(':')
var commandSlug = messageComponents[0]
var repeat = messageComponents[1]

activity = activityBySlugs(hubSlug, activitySlug)
hubState = harmonyHubStates[hubSlug]
if (!hubState) { return }

activity = activityBySlugs(hubSlug, hubState.current_activity.slug)
if (!activity) { return }

command = activity.commands[commandSlug]
Expand Down

0 comments on commit a851ff7

Please sign in to comment.