Closed feinstein closed 1 month ago
Thanks! Labeling it as good first issue. If you or anyone else want to make the PR to resolve that, I'm happy to merge!
No need to fix, it's just a preference of style. Copying to a local variable is safer, but just for extreme cases.
The painter's code have this question:
The answer is, the compiler can't know if a class' filed is always
null
or not, because this field could be a getter that returnsnull
sometimes and returns a value other times. You need to use the!
operator or you can copy that field to a local variable and check that variable, then the compiler knows it's notnull
at all.Example: