References are not a magical spell that guarantees a pointer is non-null. While they help avoid this, because of the way C++ behaves it may result in a null object as well, so a run-time check is still needed.
> While they help avoid this, because of the way C++ behaves it may result in a null object as well, so a run-time check is still needed.
I think the difference is that with references you can only perform such a check before you create the reference. Pretty sure optimizers can and will elide checks for null references.
What references avoid is the unnecessary addition of nullability, not nullability at the source. They also convey that non-nullability to the compiler and user of your API directly, rather than hoping that point-of-use null checks convey the same thing. You still need null checks if you have nullable items, but better to localize those checks specifically where needed than scatter them across your codebase.
Amusingly, the Chromium folks found this out firsthand when working on Rust bindings - all of the unnecessary pointer arguments due to the GSG complicated the process.