Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72521860 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change I8f657a99 into eclair

* changes:
  Avoid a crash trying to get a substring whose start is after its end.
parents 7c0f00cc 32929413
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -4531,6 +4531,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                    // Now use the delta to determine the actual amount of text
                    // Now use the delta to determine the actual amount of text
                    // we need.
                    // we need.
                    partialEndOffset += delta;
                    partialEndOffset += delta;
                    if (partialStartOffset > N) {
                        partialStartOffset = N;
                    } else if (partialStartOffset < 0) {
                        partialStartOffset = 0;
                    }
                    if (partialEndOffset > N) {
                    if (partialEndOffset > N) {
                        partialEndOffset = N;
                        partialEndOffset = N;
                    } else if (partialEndOffset < 0) {
                    } else if (partialEndOffset < 0) {