-
Notifications
You must be signed in to change notification settings - Fork 127
Correct null dereference exception on unusual import URIs #2429
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
Conversation
I think it would be useful to emit a warning like the Lines 152 to 157 in 6d3c360
|
lib/src/model/package_graph.dart
Outdated
return null; | ||
} | ||
var foundLibrary = Library.fromLibraryResult( | ||
var foundLibrary; | ||
foundLibrary = findButDoNotCreateLibraryFor(libraryElement); |
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.
Why declare this on line 891 and then initialize it on 892?
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.
No good reason, I just rewrote these sections of code too many times working on this. Fixed.
I'm not entirely opposed to the idea, but I wonder if that might better belong in the linter. Filed as #2431. |
Fixes #2426.
BREAKING CHANGE for PackageGraph.allLibraries (change of key type).
Import URIs that resolve via unusual paths, but otherwise map to the "same" library, result in a null pointer exception when traversing the import/export graph. Fix this by forcing resolution to
LibraryElement
s generated for the normalized URIs.