Make app.helpers.truncate tolerant to null and undefined