When a value can be undefined/null, do not assume it exists—guard it before access and keep the type model consistent.

Rules

Outcome: fewer runtime TypeErrors and clearer, more intentional null/undefined handling across the codebase.