Added checks around contacts #3860

Contact relationships to participants in tracing module
should not be saved if the participant is nil