Skip to content

Commit

Permalink
fix "Cannot read property 'new' of undefined" init error
Browse files Browse the repository at this point in the history
  • Loading branch information
fremail committed Dec 19, 2016
1 parent 819e0c8 commit c5debe1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ alexa.request = function(json) {
return null;
}
};
// session is not included for AudioPlayer or PlaybackController requests
if (!this.data.session) {
this.data.session = {
application: this.data.context.System.application,
user: this.data.context.System.user,
device: this.data.context.System.device
};
}
this.sessionDetails = {
"new": this.data.session.new,
"sessionId": this.data.session.sessionId,
Expand Down

0 comments on commit c5debe1

Please sign in to comment.