© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4mo ago•
20 replies
Vasko

Have nullable types been changed?

var client = clients.Find(c => c?.id == id);
if (client is null)
    return Button.None;

return client.inputQueue.Dequeue();
var client = clients.Find(c => c?.id == id);
if (client is null)
    return Button.None;

return client.inputQueue.Dequeue();

this code should work since the null check should make client non nullable after but it doesn't. Client is still a nullable type after the check.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

❔ Generics and nullable types
C#CC# / help
3y ago
Don’t understand nullable reference types
C#CC# / help
4y ago
Default literal and non nullable reference types
C#CC# / help
11mo ago
❔ Nullable bools
C#CC# / help
3y ago