Skip to content

Commit

Permalink
Fix crash in comment editor
Browse files Browse the repository at this point in the history
  • Loading branch information
rubengees committed Nov 18, 2019
1 parent 30eab68 commit b25fcbc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ class EditCommentFragment : BaseContentFragment<LocalComment>(R.layout.fragment_
val startTag = "[$tag${if (value.isNotEmpty()) "=$value" else ""}]"
val endTag = "[/$tag]"

if (editor.selectionStart >= 0) {
if (editor.selectionStart >= 0 && editor.selectionEnd >= 0) {
if (editor.selectionStart == editor.selectionEnd) {
editor.text.insert(editor.selectionStart, "$startTag$endTag")
} else {
Expand Down

0 comments on commit b25fcbc

Please sign in to comment.