Fix fatal in EntityContent::getTextForFilters

@note there should be a follow up that perhaps extracts this
functionality and ensures it is covered by tests.

Bug: 70725
Change-Id: I1ad7212401d915ce2878853b6b3969333f9b7a1a