[[ Bug 11960 ]] Prevent crash with certain text selections
Merge pull request #576 from runrevali/bugfix-11960

[[ Bug 11960 ]] Prevent crash with certain text selections