Enable nullable reference types - #590
Open
Maksym Koshovyi (maxkoshevoi) wants to merge 2 commits into
Open
Conversation
Comment on lines
+241
to
+246
| Select(featureFlagFilter!, labelFilter!); | ||
|
|
||
| _multiKeyWatchers.AppendUnique(new KeyValueWatcher | ||
| { | ||
| Key = featureFlagFilter, | ||
| Label = labelFilter, | ||
| Key = featureFlagFilter!, | ||
| Label = labelFilter!, |
There was a problem hiding this comment.
Here there's no check that featureFlagSelector.KeyFilter and featureFlagSelector.LabelFilter are not null. They might be since featureFlagSelector could be initialized with SnapshotName
| } | ||
|
|
||
| Uri currentEndpoint = _configClientManager.GetEndpointForClient(clientEnumerator.Current); | ||
| Uri currentEndpoint = _configClientManager.GetEndpointForClient(clientEnumerator.Current)!; |
There was a problem hiding this comment.
IConfigurationClientManager.GetEndpointForClient can return null if it doesn't find the client, but everywhere it's used return value is never checked for null (here's an example)
| case JsonValueKind.False: | ||
| case JsonValueKind.Null: | ||
| _data.Add(new KeyValuePair<string, string>(_currentPath, element.ToString())); | ||
| _data.Add(new KeyValuePair<string, string?>(_currentPath!, element.ToString())); |
There was a problem hiding this comment.
_currentPath can be null here if we never execute EnterContext or ExitContext
|
|
||
| var configClient = _credential == null | ||
| ? new ConfigurationClient(ConnectionStringUtils.Build(targetEndpoint, _id, _secret), _clientOptions) | ||
| ? new ConfigurationClient(ConnectionStringUtils.Build(targetEndpoint, _id!, _secret!), _clientOptions) |
There was a problem hiding this comment.
If ConfigurationClientManager is initialized using the constructor with endpoints, _id and _secret will be null here
Maksym Koshovyi (maxkoshevoi)
marked this pull request as ready for review
August 21, 2024 13:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #300
Notes:
KeyValueSelectorcan ether be initialized with key and label, or snapshot so I introduced two constructors to reflect that