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

Commit e1c14e6a authored by Gilles Debunne's avatar Gilles Debunne
Browse files

Tapping on paste popup with an empty clipboard does not crash in TextView.

Change-Id: I5730ec46582862c6233a9e3a2d4bf695cd2c3e69
parent 26e37349
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -8042,10 +8042,13 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener

        @Override
        public void onClick(View v) {
            if (canPaste()) {
                ClipboardManager clipboard =
                    (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
                paste(clipboard, getSelectionStart(), getSelectionEnd());
            }
            hide();
        }

        void positionAtCursor() {
            final int offset = TextView.this.getSelectionStart();