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

EcmaScript - NullReferenceException when variable is not declared #11

Closed
ISV-Kran opened this issue Sep 18, 2020 · 1 comment
Closed
Labels
bug Something isn't working
Milestone

Comments

@ISV-Kran
Copy link

ISV-Kran commented Sep 18, 2020

Hi adams85,

On javascript when a variable is not declared we get System.NullReferenceException: 'Object reference not set to an instance of an object.' at VisitVariableDeclarator.

[TO REPRODUCE]
On TypeScriptDemo add to foo.ts var i, length; just after the _timeout function.

[POSSIBLE FIX]
Execute Visit(variableDeclarator.Init) only if Init is not null

protected override void VisitVariableDeclarator(VariableDeclarator variableDeclarator)
{
if (variableDeclarator.Init != null)
{
// id skipped
Visit(variableDeclarator.Init);
}
}

Thank you

(I'm actually looking how to pull new request, sry i'm new to github)

@adams85 adams85 added the bug Something isn't working label Sep 18, 2020
@adams85 adams85 added this to the 3.4.1 milestone Sep 18, 2020
adams85 added a commit that referenced this issue Sep 18, 2020
@adams85
Copy link
Owner

adams85 commented Sep 18, 2020

Nice catch! 👍

The bug will be fixed by v3.4.1 which will be available on NuGet soon.

@adams85 adams85 closed this as completed Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants