Truncate Filter: handle no text

Added an if statement that handles the case where the incoming text is
either null, undefined, or an empty string. It will return undefined for
that scenario.