CRM-14984: fix notice during rendering entity ref field

CRM-14984: fix notice during rendering entity ref field