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

NullReferenceException in HighlightHelper (v8.9.34) #136

Closed
Bergam64 opened this issue Feb 22, 2022 · 3 comments
Closed

NullReferenceException in HighlightHelper (v8.9.34) #136

Bergam64 opened this issue Feb 22, 2022 · 3 comments
Assignees
Labels

Comments

@Bergam64
Copy link

Hello Samir,

Since I have started using v8.9.34, I see many of the following exceptions in the Output Window (part "Extensions"):

System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at CodeNav.Helpers.HighlightHelper.<FindItemContainer>d__6.MoveNext() in D:\a\CodeNav\CodeNav\CodeNav.Shared\Helpers\HighlightHelper.cs:line 153
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at CodeNav.Helpers.HighlightHelper.<Highlight>d__5.MoveNext() in D:\a\CodeNav\CodeNav\CodeNav.Shared\Helpers\HighlightHelper.cs:line 106
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object.
   at CodeNav.Helpers.HighlightHelper.<FindItemContainer>d__6.MoveNext() in D:\a\CodeNav\CodeNav\CodeNav.Shared\Helpers\HighlightHelper.cs:line 153
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

Consequently, auto-highlighting is broken.

I don't have a precise repro scenario for this one, but it happens often, mostly by just clicking in the C# code being edited.

Please fix this.

A little piece of advice: have you ever considered enabling C# 8 Nullable Reference Types feature in your project(s)? This would definitely help anticipating this kind of issues.

Thanks in advance,
Didier

@Bergam64
Copy link
Author

(forgot to mention: I'm using VS 2019 v16.11.4)

sboulema pushed a commit that referenced this issue Feb 23, 2022
@sboulema sboulema self-assigned this Feb 23, 2022
@sboulema sboulema added the bug label Feb 23, 2022
@sboulema
Copy link
Owner

Thanks for reporting!

Should be fixed in the latest release (8.9.40)

I took your advice and enabled nullable, as you noticed it has caused some regressions, but lets hope it puts and end to the null ref exceptions

@Bergam64
Copy link
Author

Hello Samir,

The issue seems to be fixed, indeed.

Best regards,
Didier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants