[[ Bug 13352 ]] Prevent crash due to string index out of bounds
Merge pull request #1130 from runrevali/bugfix-13352

[[ Bug 13352 ]] Prevent crash due to string index out of bounds