Check for null before dereference on RootPackage.HomePages#704
Conversation
RootPackage.Homepage can return null to indicate that no root package exists. This causes two potential null dereferences in `DependencyNode.cs` This fix just adds a null check before accessing the enumerator on the `Homepages` property.
|
Hi @mjbvz, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
TTYL, MSBOT; |
|
👍 - looks fine, though afaik Homepages is never null. Out of curiosity, was specific time when this was not the case, or did you just fix up as you came across it? |
|
Debugging new project creation, I was hitting null dereferences in these two locations. I don't know specifically what step of project creation it was in at the time, but the |
|
Oh, interesting... good catch! |
Check for null before dereference on RootPackage.HomePages
Defect
RootPackage.Homepagecan return null to indicate that no root packageexists. This causes two potential null dereferences in
DependencyNode.csFix
This fix just adds a null check before accessing the enumerator on the
HomePagesproperty.