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 Terms Parsing #244

Closed
Enkidu93 opened this issue Sep 16, 2024 · 2 comments · Fixed by #246
Closed

NullReferenceException in Terms Parsing #244

Enkidu93 opened this issue Sep 16, 2024 · 2 comments · Fixed by #246
Assignees

Comments

@Enkidu93
Copy link
Collaborator

Enkidu93 commented Sep 16, 2024

We recently got this error on production:

System.NullReferenceException: Object reference not set to an instance of an object.
         at System.Linq.Lookup`2.Create[TSource](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
         at System.Linq.GroupedEnumerable`3.GetEnumerator()
         at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
         at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
         at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
         at SIL.Machine.Corpora.ParatextProjectTermsParserBase.Parse(IEnumerable`1 termCategories, Boolean useTermGlosses)

Unfortunately, we don't have line numbers for the Machine code so it's not clear which ToDictionary is causing this. It's possible that it's getting a null gloss value from the xml(?).

@johnml1135
Copy link
Collaborator

johnml1135 commented Sep 16, 2024

I can't find the build on the server, or the database - 66e4aeeae234a38f4faa59b3.

My best guess for a resolution is to have both "SelectsMany" calls above the ToDictionary have a null coalescing because this is .netstandard2.0 and has no explicit null checking enforcement.

Still, we should create dummy data to recreate the failure and have the code change fix it.

@johnml1135 johnml1135 self-assigned this Sep 16, 2024
@johnml1135
Copy link
Collaborator

I can't recreate the error. I'm passing on this until we get better data.

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

Successfully merging a pull request may close this issue.

2 participants