#776 App crash when selected

This commit is contained in:
Stefan Niedermann 2020-04-01 19:38:43 +02:00
parent 847a6f5f9a
commit e973295eaf
2 changed files with 10 additions and 5 deletions

View file

@ -45,11 +45,15 @@ public class ContextBasedFormattingCallback implements ActionMode.Callback {
endOfLine--;
}
}
try {
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 (StringIndexOutOfBoundsException e) {
Log.e(TAG, e.getMessage(), e);
}
} else {
Log.e(TAG, "SelectionStart is " + originalCursorPosition + ". Expected to be between 0 and " + text.length());
}

View file

@ -0,0 +1 @@
- App crash when selected (#776)