Optional Safety — E0070–E0073
← Coercion Safety | Next: Unused Code →
BSK-E0070 — Attribute access on Optional
A method or attribute is accessed on a value that may be None.
def get_name(user: User | None) -> str:
return user.name # Error — user may be None