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