diff --git a/Tusker/Screens/Compose/ComposeContentWarningTextField.swift b/Tusker/Screens/Compose/ComposeContentWarningTextField.swift index 70059cee..973ccd59 100644 --- a/Tusker/Screens/Compose/ComposeContentWarningTextField.swift +++ b/Tusker/Screens/Compose/ComposeContentWarningTextField.swift @@ -147,6 +147,10 @@ struct ComposeContentWarningTextField: UIViewRepresentable { let selectedRangeStartUTF16 = textField.offset(from: textField.beginningOfDocument, to: selectedRange.start) let cursorIndex = text.utf16.index(text.startIndex, offsetBy: selectedRangeStartUTF16) + guard cursorIndex != text.startIndex else { + return nil + } + var lastWordStartIndex = text.index(before: cursorIndex) while true { let c = text[lastWordStartIndex]