C
C#2y ago
razkanaz

✅ removing ugly yellow lines in vscode

i finished working on some homework, and there is an error that will never appear under the circumstance of the homework i just want to be finished with the file, i did the assignment i just wanna make the folders look cleaner, without it being colored yellow but i still wanna see errors in other files, is there a way to fix this?
5 Replies
Angius
Angius2y ago
Fix the warning...? Yellow underline means it's just a warning, those are usually easy to fix So post some $code and we'll see what's wrong
MODiX
MODiX2y ago
To post C# code type the following: ```cs // code here ``` Get an example by typing $codegif in chat If your code is too long, post it to: https://paste.mod.gg/
razkanaz
razkanazOP2y ago
string hexcode = Console.ReadLine();
Console.WriteLine(HexCodeCheck(hexcode));
string hexcode = Console.ReadLine();
Console.WriteLine(HexCodeCheck(hexcode));
the error is "Converting null literal or possible null value to non-nullable type."
Angius
Angius2y ago
Ah, simple fix
string hexcode = Console.ReadLine() ?? "";
string hexcode = Console.ReadLine() ?? "";
?? provides a fallback for nullable values
razkanaz
razkanazOP2y ago
ah tysm
Want results from more Discord servers?
Add your server