mat1jaczyyy / LP-Firmware-Utility

Novation Launchpad firmware updating and patching on the web
https://fw.mat1jaczyyy.com/
39 stars 7 forks source link

Put return inside catch block #1

Closed Brendonovich closed 4 years ago

Brendonovich commented 4 years ago

Probs not a huge deal since the try block has a return in it, but though I would change it for peace of mind.

mat1jaczyyy commented 4 years ago

The JavaScript noob in me is asking what happens if L97 and L103 fails and the function ends without returning anything? Honestly the previous implementation gives me more peace of mind

Brendonovich commented 4 years ago

If webAss doesn't return anything, it's value will be undefined which is falsey, so the if(!webAss) will still work properly. But yeah I guess it does give peace of mind having it outside.

Brendonovich commented 4 years ago

rewriting anyway so doesnt matter