-
Notifications
You must be signed in to change notification settings - Fork 673
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
Fixes #688 by Handling null _vars #703
Conversation
_vars was being set to null in at least on spot (ModuleAnalysis 455). Now it is set as an empty list in cases where it could come as null.
I am working on adding a test for this yet, but this is my proposed patch. |
Are we sure that this is the only place where it's not handling null? Should the fix rather be removing that one single case where null is used, and replacing it with an empty collection? It looks like the code tries really hard to avoid nulls elsewhere. |
I considered doing that also. These are all of the constructors. Granted, you are correct that we could still do it incorrectly. Any thoughts on doing both? |
Never mind, having had a look at the actual code diff I'm actually fine with either. |
👍 |
@@ -451,8 +451,8 @@ private class ErrorWalker : PythonWalker { | |||
.Select(s => new MemberResult(s.Name, s.GetMergedAnalysisValues())) | |||
.ToList(); | |||
} catch (Exception) { | |||
// TODO: log exception |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This TODO should stay here, though we probably need to let the exception propagate to be able to log it from outside Analysis.dll.
Go ahead and merge after adding the comment back. |
Fixes #688 by Handling null _vars
_vars was being set to null in at least on spot (ModuleAnalysis 455).
Now it is set as an empty list in cases where it could come as null.