Worked example
Dog nobody = null;
System.out.println(nobody); // null
System.out.println(nobody == null); // true
System.out.println(nobody.name); // CRASH: NullPointerException
The crash message is explicit: Cannot read field "name" because ... is null. There is no object, so there is no field to read.
Guard with a check before you touch anything: if (d != null) { ... }. This is the single most common runtime error in Java.