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

Unhandled exception: Cannot read property 'catch' of null inside non-template JSON files #35

Closed
StephenWeatherford opened this issue Mar 6, 2018 · 0 comments
Assignees
Labels
Milestone

Comments

@StephenWeatherford
Copy link
Contributor

I get this when deleting and then re-adding one of the commas in a dependencies section in an extension package.json file.

TypeError: Cannot read property 'catch' of null
at AzureRMTools.onProvideSignatureHelp (c:\Repos\vscode-azurearmtools\src\AzureRMTools.ts:554:23)
at Object.provideSignatureHelp (c:\Repos\vscode-azurearmtools\src\AzureRMTools.ts:215:45)
at c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:635:403

private onProvideSignatureHelp(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Promise<vscode.SignatureHelp> {
    let result: Promise<vscode.SignatureHelp> = null;

    this.logOnError(() => {
        const deploymentTemplate: DeploymentTemplate = this.getDeploymentTemplate(document);
        if (deploymentTemplate) {
            const context: PositionContext = deploymentTemplate.getContextFromDocumentLineAndColumnIndexes(position.line, position.character);

            result = context.signatureHelp.then((functionSignatureHelp: TLE.FunctionSignatureHelp) => {
                let signatureHelp: vscode.SignatureHelp = null;

                **if (functionSignatureHelp) {**

...
}

                return signatureHelp;
            });
        }
    });


    return result.catch((error: any) => {    <<< result can be null
@StephenWeatherford StephenWeatherford changed the title Cannot read property 'catch' of null Unhandled exception: Cannot read property 'catch' of null Mar 6, 2018
@StephenWeatherford StephenWeatherford added this to the 0.4.1 milestone Mar 20, 2018
@StephenWeatherford StephenWeatherford added P1 and removed P2 labels Apr 18, 2018
@StephenWeatherford StephenWeatherford self-assigned this Apr 18, 2018
@StephenWeatherford StephenWeatherford changed the title Unhandled exception: Cannot read property 'catch' of null Unhandled exception: Cannot read property 'catch' of null inside non-template JSON files Apr 19, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant