Prevent panic on invalid map key access