calva icon indicating copy to clipboard operation
calva copied to clipboard

Refactor lsp getServerInfo function to avoid potential null error

Open bpringe opened this issue 3 years ago • 2 comments

I'm making this as a reminder to address this: https://github.com/BetterThanTomorrow/calva/pull/1602/files#r830554919. I don't have time to address it right now, but an issue is better than nothing 😄 . @corasaurus-hex did verify that it is an issue (not that it has caused a problem yet, necessarily, but it could).

bpringe avatar Apr 14 '22 01:04 bpringe

Seems to be a simple fix - just re-throw the exception and maybe add a try catch to one call site that checks if the return is truthy.

bpringe avatar Apr 14 '22 02:04 bpringe

we have just the function for that https://github.com/BetterThanTomorrow/calva/blob/5e780daa4ba6083eb75817c094ca68019a00dfbb/src/utilities.ts#L30-L39 🥳

corasaurus-hex avatar Apr 14 '22 23:04 corasaurus-hex