C
C#2y ago
avery

❔ I feel extremely embarrassed................

GUYS DON'T JUDGE ME IF DUMB AS SH#T
6 Replies
FestivalDelGelato
ok?
Buddy
Buddy2y ago
$ask
MODiX
MODiX2y ago
How to get the best help catpog Make a post in #help or one of the topic channels under Development. Avoid askingcatthinking Can anybody help catthinking Has anyone used catthinking Why doesn't my code work? C# is a big area! No one knows they can help unless you tell them about the small area you're trying to work in. Explain what you are doing, and potentially why for as much context as possible. Avoid screenshots where possible, share code directly in Discord. Type $code into chat to learn how to post code. See https://www.nohello.net and https://dontasktoask.com if you want common help chat room etiquette.
Monsieur Wholesome
that's just a warning, not an error fyi
Thinker
Thinker2y ago
Assuming your question is "why am I getting this warning", Console.ReadLine() can in some circumstances return null, which is what the warning is telling you. There are three ways to fix it: 1. Make the type of userName string? instead of string, which just means that the variable can be null. 2. Add ?? "" after Console.ReadLine() which just means that the value should be an empty string if Console.ReadLine() returns null. 3. Add a ! after Console.ReadLine() in order to just make the compiler shut up about the warning. Although as mentioned, that's a warning, not an error, which means that your code will compile just fine, but you may get runtime errors because of it.
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?