E4010 Reference Errors

nil-member-access

cannot access member of nil

When this occurs

`nilValue.field`

Example error message

error[E4010]: nil reference: cannot access member 'x' of nil

How to fix

Check that the value is not nil before accessing members. Use conditional checks.

Related errors