qeled / discordie

Predictable JavaScript abstractions for Discord API.
https://qeled.github.io/discordie/
BSD 2-Clause "Simplified" License
190 stars 45 forks source link

fix bug in nopus when no process.argv[1] is present #30

Closed briantanner closed 8 years ago

briantanner commented 8 years ago

This is a little obscure, but running node with no process.argv[1], nopus throws a type error: Cannot read property 'replace' of undefined. This was caused by this line: Module["thisProgram"]=process["argv"][1].replace(/\\/g, "/"); The fix for this was to replace this with: Module["thisProgram"]=process["argv"][1]?process["argv"][1].replace(/\\/g, "/"):null;

Doing this doesn't seem to have any negative side-effects as nopus is checking this property and setting a default value later in code.

qeled commented 8 years ago

Rebased.