amazon-archives / legacy-skill-samples-java

These samples utilize a version of the Alexa Skills Kit SDK that is no longer supported. Please visit https://github.com/alexa/alexa-skills-kit-sdk-for-java
https://github.com/alexa/alexa-skills-kit-sdk-for-java
Other
94 stars 142 forks source link

NPE in DeviceAddressSpeechlet #1

Closed rmueller83 closed 7 years ago

rmueller83 commented 7 years ago

https://github.com/alexa/skill-samples-java/blob/1520b024a9eb0fd1a0c08506ac002309491a4ae9/address/src/com/amazon/asksdk/address/DeviceAddressSpeechlet.java#L129 fails with an NPE if the user has not given permission.

https://developer.amazon.com/docs/custom-skills/request-and-response-json-reference.html says "The accessToken field will not appear if null, and the permissions object also will not appear if consentToken is null.".

So the null check 2 lines below which checks the consentToken should be done on the permission object.

TianTXie commented 7 years ago

Fixed in commit e01634712652e238ea7535fc85ff051eed819eac