Skip to content

Commit

Permalink
fix: add safety check on auth response
Browse files Browse the repository at this point in the history
  • Loading branch information
mvayngrib committed Apr 20, 2018
1 parent 4db957d commit c83bc96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ export default class User {
if (!session) return

const { clientPosition} = session
if (!clientPosition) {
this.logger.error('expected session to have clientPosition', { session })
if (!(clientPosition && clientPosition.received)) {
this.logger.error('expected session to have clientPosition.received', { session })
await this.requestIotClientReconnect({ event: 'announcePosition', clientId })
return
}
Expand Down

0 comments on commit c83bc96

Please sign in to comment.