Skip to content

Commit

Permalink
fix: crash in rare cases when a owner changes (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbender9 authored Mar 30, 2024
1 parent 7afde8c commit 4c594d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dbus-listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ module.exports = function (app, messageCallback, address, plugin, pollInterval)
// a process to manage settings on the dbus, the logger to VRM Portal
// and others. All services that send out data for connected devices do
// have the /DeviceInstance path.
app.debug(`warning: error getting device instance for ${name}`)
services[owner].deviceInstance = 99
if ( services[owner] ) {
app.debug(`warning: error getting device instance for ${name}`)
services[owner].deviceInstance = 99
}
} else {
services[owner].deviceInstance = res[1][0]
}
Expand Down

0 comments on commit 4c594d5

Please sign in to comment.