Skip to content

Conversation

notherno
Copy link

@notherno notherno commented Apr 5, 2023

What I changed

  • Parsing of arguments JSON condition in executeCommand command
  • Call of executeCommand function without arguments

Why

When we set StreamDeck action arguments (JSON) to blank, the payload structure from StreamDeck plugin is like following example:

Message received, ExecuteCommandMessage.: {"id":"ExecuteCommandMessage","data":"{\"command\":\"editor.action.formatDocument\",\"arguments\":\"\"}"}

This may cause following JSON parse error.

Uncaught SyntaxError: Unexpected end of JSON input`

This PR fixes this problem.

Related issues

fixes #35

}
}

if (commandArguments) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value of commandArguments is undefined, thus this if statement should be unnecessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Unexpected end of JSON input" in console

1 participant