Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I modified js/index.js slightly to deal with errors in Lambda Console Test #4

Closed
wants to merge 1 commit into
base: mainline
from

Conversation

Projects
None yet
4 participants
@scottbea
Copy link

scottbea commented Aug 29, 2016

The issue I found was that the code in js/index.js throws an error when used in the Lambda Console for Test. This line of code causes problems:

if (event.context.System.device.supportedInterfaces.AudioPlayer === undefined)

The Lambda Console does not have an event.context.System object, so we are access a property of an undefined object. My fix was simply this:

var audioPlayerInterface = ((((event.context || {}).System || {}).device || {}).supportedInterfaces || {}).AudioPlayer;
if (audioPlayerInterface === undefined) {

This works fine now in the Lambda Console when performing a test.

I modified the index.js slightly to deal with a case where the event.…
…context.System object is undefined, and the subsequent error that throws when the device.supportedInterfaces.AudioPlayer property path is deferenced. I simply used the cautious dereferencing approach for the object path, but we might want to revisit the approach with exception handling. The result is that the code works as expected now.
@tredavis

This comment has been minimized.

Copy link

tredavis commented Sep 20, 2016

I trust that this is an actual fix. Can we get this pulled in? I spent 3 hours trying to solve the same problem. I ended up just commenting out that line of code.

@rsokz

This comment has been minimized.

Copy link

rsokz commented Dec 14, 2016

Can we this get pulled in please? Why have there been no updates for 4 months...?

@sebsto

This comment has been minimized.

Copy link
Contributor

sebsto commented Oct 15, 2017

Thank you for fixing this.
This fix is now included in our staging repository and will be pushed here soon.

@akersh-s akersh-s closed this in deeffbc Oct 15, 2017

akersh-s added a commit that referenced this pull request Oct 15, 2017

Merge pull request #4 from sebsto/Github
Fixes for Multi Streams README & Code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.