Targets might be nil, so we should avoid calling in those situations

When matching arrays on have_sent_email_matcher, they might be nil. In those cases, it raises when calling target.sort!

This pull request fixes it by skipping the check unless both are present.