Fix #24409: crash when adding textual elements

Adds another test for TLine::_text being empty or not.