-
Notifications
You must be signed in to change notification settings - Fork 1.9k
C#: Fix some new compiler warnings #18246
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
| if (chain is null || cert is null) | ||
| { | ||
| return false; | ||
| } |
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.
Should we log something in this case? Do we expect any of these to be null in any circumstance?
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.
Good question, I am not really familiar with this API. This was the minimal change I could make that just replaced a potential crash with a failed validation instead.
@mbg : Do you have an opinion about it?
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 opinion. I couldn't see anything obvious in the docs about when these might be null and they were never null during testing. I didn't implement any checks for whether these are null, since I figured that would be more helpful to know under what circumstances they end up being null than just return false.
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.
Ok, that indicates that we should add a log message in case these are null.
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.
Yep, I was just about to add that I guess logging it as @tamasvajk suggested would make sense.
790c7d0 to
86c6df5
Compare
csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs
Outdated
Show resolved
Hide resolved
mbg
left a comment
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.
Thank you for addressing those details!
A couple of new compiler warnings (since Friday)
DCA looks good.