Merge "Prevent index out of bounds when using String.substring." into lmp-sprout-dev