Merge "Avoid NPE in trimToLengthWithEllipsis()."