R003warning

Field read through nil

A template read a field through a pointer that was nil.

Templates guard field access through pointers that may be nil. Instead of panicking, the expression gives the field's zero value and this warning is recorded. The build reports the risk ahead of time as T101.

Check the value before using it, such as p-if="state.User != nil", or make sure Render sets it.

$ piko explain R003

Build output ends each diagnostic with a link to this page, and editors using the Piko language server link the code under the squiggle. Look for CodeNilPropertyAccess in Piko's source to see where it is reported.