Fixed empty id cause error when trigger referral.