Before following a nested path, a condition can check whether the intermediate object exists.
Complete getEmailLabel(profile) so it returns the nested email when contact exists and No email otherwise. The existing calls must display Mira: [email protected] and Leo: No email without causing an error.