andrehaveman / spotify-node-applescript

Control Spotify on Mac OSX with NodeJS and AppleScript
MIT License
316 stars 38 forks source link

Check result for undefined and prevent JSON Parse #28

Open bpeters opened 8 years ago

bpeters commented 8 years ago

I was running into issues where getState script would result in undefined which would cause the JSON.parse(result) to throw and error.

andrehaveman commented 8 years ago

I don't see the use of this change. The JSON.parse error is already handled by try/catch block. This change leads to the undesired result that the callback is called without an error and also without a result.

Alutun commented 7 years ago

@bpeters Di you find the cause of it ? i'm running into the same issue and cannot find the root cause of this.

will234 commented 7 years ago

nn

nzec commented 6 years ago

@bpeters I don't think this fixes the problem.