Don’t unconditionally dereference a pointer that is sometimes null.

Should fix all of the currently failing tests…