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

Commit 15208b52 authored by Stefan Niedermann's avatar Stefan Niedermann
Browse files

#776 App crash when selected - remove obsolete catch block

parent 3940595e
Loading
Loading
Loading
Loading
+5 −9
Original line number Diff line number Diff line
@@ -40,16 +40,12 @@ public class ContextBasedFormattingCallback implements ActionMode.Callback {
        int originalCursorPosition = editText.getSelectionStart();
        if (originalCursorPosition >= 0 && originalCursorPosition <= text.length()) {
            int startOfLine = getStartOfLine(text, originalCursorPosition);
            try {
            int endOfLine = getEndOfLine(text, startOfLine);
            String line = text.subSequence(startOfLine, endOfLine).toString();
            if (MarkDownUtil.lineStartsWithCheckbox(line)) {
                menu.findItem(R.id.checkbox).setVisible(false);
                Log.i(TAG, "Hide checkbox menu item because line starts already with checkbox");
            }
            } catch (IndexOutOfBoundsException e) {
                Log.e(TAG, e.getMessage(), e);
            }
        } else {
            Log.e(TAG, "SelectionStart is " + originalCursorPosition + ". Expected to be between 0 and " + text.length());
        }