Skip to content

Conversation

@zhiyuanliang-ms
Copy link
Member

@zhiyuanliang-ms zhiyuanliang-ms marked this pull request as ready for review March 7, 2024 14:27
public PercentageFilter(ILoggerFactory loggerFactory = null)
{
_logger = loggerFactory.CreateLogger<PercentageFilter>();
_logger = loggerFactory?.CreateLogger<PercentageFilter>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prior to this PR, before we have a default null value for loggerFactory, am I allowed to explicitly pass a null as parameter, i.e. new PercentageFilter(null)? If so, this PR also fixes the potential NPE, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

@zhiyuanliang-ms zhiyuanliang-ms merged commit 5c34b8c into main Mar 14, 2024
@zhiyuanliang-ms zhiyuanliang-ms deleted the zhiyuanliang/update-filter-constructor branch March 14, 2024 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants