Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read properties of null (reading 'concat') #8

Closed
vdesabou opened this issue Oct 11, 2023 · 2 comments
Closed

TypeError: Cannot read properties of null (reading 'concat') #8

vdesabou opened this issue Oct 11, 2023 · 2 comments

Comments

@vdesabou
Copy link

I was getting issue with sub-subcommand:

[Extension Host] [Completion] No completion item is available (1) TypeError: Cannot read properties of null (reading 'concat')
	at getOptions (/Users/vsaboulin/.vscode/extensions/tetradresearch.vscode-h2o-0.2.12/out/extension.js:558:40)
	at getCompletionsOptions (/Users/vsaboulin/.vscode/extensions/tetradresearch.vscode-h2o-0.2.12/out/extension.js:524:21)
	at Object.<anonymous> (/Users/vsaboulin/.vscode/extensions/tetradresearch.vscode-h2o-0.2.12/out/extension.js:66:47)
	at Generator.next (<anonymous>)
	at fulfilled (/Users/vsaboulin/.vscode/extensions/tetradresearch.vscode-h2o-0.2.12/out/extension.js:5:58)

I fixed it by changing:

const options = deepestCmd.options.concat(...inheritedOptionsArray);

to

const options = (!!deepestCmd && !!deepestCmd.options) ? deepestCmd.options.concat(...inheritedOptionsArray) : [];

It's probably not the best code, but that seems to work in my case

yamaton added a commit that referenced this issue Oct 12, 2023
@yamaton
Copy link
Owner

yamaton commented Oct 12, 2023

Thank you so much for your report and the fix!
I've added it, and published as 0.2.13.

@vdesabou
Copy link
Author

Works perfectly now !

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

No branches or pull requests

2 participants