❔ help with code

what is the problem in this code?
11 Replies
phaseshift
phaseshift2y ago
Don't know, what is the problem?
SmolLime117
SmolLime117OP2y ago
i dont understand why it is highlighting Console.ReadLine(); yellow
Thinker
Thinker2y ago
the only thing there is a warning it's not an error
phaseshift
phaseshift2y ago
It tells you when you mouse over it
SmolLime117
SmolLime117OP2y ago
yeah but even when there is nothing there is says there is a problem
Thinker
Thinker2y ago
that's just vscode being vscode restart vsc and it'll probably be fixed
SmolLime117
SmolLime117OP2y ago
oh
Thinker
Thinker2y ago
but anyway, the warning itself says that the result of Console.ReadLine() may be null You can solve this either by doing Console.ReadLine() ?? "" or doing Console.ReadLine()! The first of which is kinda the most preferable
SmolLime117
SmolLime117OP2y ago
oh ok that makes sense thanks
Thinker
Thinker2y ago
a ?? b essentially means "if a is not null then return a from the expression, otherwise return b"
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.
Want results from more Discord servers?
Add your server