Refactor views for Nullable Reference Types? #11289
Replies: 1 comment 4 replies
-
i think these might make a good candidate for hacktoberfest ? the majority of the issues appear to be in the templates folder these files aren't directly used by a site, but they are what you get when you add a new partial macro and pick from a template. a quick look and i think most of them need some basic null checking. eg. loginstatus.cshtml, has :
and something like this would fix it: (interestingly this line would never be hit if any of it was null and its checked higher up - i don't know if this is a bug or limitation in the nullable reference code)
|
Beta Was this translation helpful? Give feedback.
-
Two of my favourite new features in .NET core are Nullable Reference Types and Razor compilation.
With both switched on, I get a lot of warnings from the Umbraco views that are imported into my project.
I know that these views will work but I think it would be best if these warnings can be fixed or suppressed. We could refactor the views and add in the necessary null conditionals/checks etc. or, simply add
#nullable disable
to the files in question.Beta Was this translation helpful? Give feedback.
All reactions