Skip to content

Commit

Permalink
fix: uncaught exception for openApp when app not installed (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlfieBrooks authored Dec 23, 2023
1 parent a6f9e71 commit d563e42
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/samsung.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,12 @@ class Samsung {

if (!app) {
this.LOGGER.error('This APP is not installed', { appId, app }, 'openApp getAppsFromTV')
throw new Error('This APP is not installed')
if (done) {
done(new Error('This APP is not installed'), null);
}
} else {
this._send(getMsgLaunchApp(app), done)
}

this._send(getMsgLaunchApp(app), done)
})
}

Expand Down Expand Up @@ -545,11 +547,9 @@ class Samsung {
}

private _getWSUrl() {
return `${this.PORT === 8001 ? 'ws' : 'wss'}://${this.IP}:${
this.PORT
}/api/v2/channels/samsung.remote.control?name=${this.NAME_APP}${
this.TOKEN !== '' ? `&token=${this.TOKEN}` : ''
}`
return `${this.PORT === 8001 ? 'ws' : 'wss'}://${this.IP}:${this.PORT
}/api/v2/channels/samsung.remote.control?name=${this.NAME_APP}${this.TOKEN !== '' ? `&token=${this.TOKEN}` : ''
}`
}
}

Expand Down

0 comments on commit d563e42

Please sign in to comment.