martin-g commented on a change in pull request #1480:
URL: https://github.com/apache/avro/pull/1480#discussion_r795242867
##########
File path: lang/csharp/src/apache/main/CodeGen/CodeGen.cs
##########
@@ -220,7 +227,10 @@ protected virtual SchemaNames generateNames(Schema schema)
protected virtual void addName(Schema schema, SchemaNames names)
{
NamedSchema ns = schema as NamedSchema;
- if (null != ns) if (names.Contains(ns.SchemaName)) return;
+ if (ns != null && names?.Contains(ns.SchemaName) == true)
Review comment:
Why names`?` ?
AFAIS it cannot be `null`.
Now GitHub reports the following for line 250:
```
Check warning on line 250 in lang/csharp/src/apache/main/CodeGen/CodeGen.cs
Code scanning
Dereferenced variable may be null
Warning
Variable
may be null here as suggested by
null check.
Show more details
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]