If p == null the access p.name would lead to a run-time error. However, since the expression
p != null && p.name != "John"
already yields false if p == null, this error cannot occur.